Skip to content

Commit fb40473

Browse files
committed
DO-NOT-MERGE: add debug logging
1 parent 4d280bd commit fb40473

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/controllers/common/external_oidc.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/openshift/library-go/pkg/controller/factory"
1313
corev1informers "k8s.io/client-go/informers/core/v1"
1414
"k8s.io/client-go/tools/cache"
15+
"k8s.io/klog/v2"
1516

1617
"k8s.io/apimachinery/pkg/api/errors"
1718
"k8s.io/apimachinery/pkg/util/sets"
@@ -93,6 +94,7 @@ func (c *AuthConfigChecker) OIDCAvailable() (bool, error) {
9394
// ensure every observed revision includes an auth-config revisioned configmap
9495
_, err := c.kasConfigMapLister.ConfigMaps("openshift-kube-apiserver").Get(fmt.Sprintf("auth-config-%d", revision))
9596
if errors.IsNotFound(err) {
97+
klog.Infof("[debug-801] configmap auth-config-%d not found", revision)
9698
return false, nil
9799
} else if err != nil {
98100
return false, fmt.Errorf("getting configmap openshift-kube-apiserver/auth-config-%d: %v", revision, err)
@@ -109,6 +111,7 @@ func (c *AuthConfigChecker) OIDCAvailable() (bool, error) {
109111
if !strings.Contains(cm.Data["config.yaml"], `"oauthMetadataFile":""`) ||
110112
strings.Contains(cm.Data["config.yaml"], `"authentication-token-webhook-config-file":`) ||
111113
!strings.Contains(cm.Data["config.yaml"], `"authentication-config":["/etc/kubernetes/static-pod-resources/configmaps/auth-config/auth-config.json"]`) {
114+
klog.Infof("[debug-801] configmap config-%d does not contain expected OIDC config", revision)
112115
return false, nil
113116
}
114117
}

pkg/libs/endpointaccessible/endpoint_accessible_controller.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
apierrors "k8s.io/apimachinery/pkg/api/errors"
1313
utilerrors "k8s.io/apimachinery/pkg/util/errors"
1414
"k8s.io/apimachinery/pkg/util/wait"
15+
"k8s.io/klog/v2"
1516

1617
operatorv1 "github.com/openshift/api/operator/v1"
1718
applyoperatorv1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1"
@@ -78,14 +79,20 @@ func humanizeError(err error) error {
7879

7980
func (c *endpointAccessibleController) sync(ctx context.Context, syncCtx factory.SyncContext) error {
8081
if c.endpointCheckDisabledFunc != nil {
82+
klog.Infof("[debug-801] found non-nil endpointCheckDisabledFunc")
8183
if skip, err := c.endpointCheckDisabledFunc(); err != nil {
84+
klog.Errorf("[debug-801] endpointCheckDisabledFunc returned an error: %v", err)
8285
return err
8386
} else if skip {
8487
// Server-Side-Apply with an empty operator status for the specific field manager
8588
// will effectively remove any conditions owned by it since the list type in the
8689
// API definition is 'map'
90+
klog.Infof("[debug-801] endpointCheckDisabledFunc returned true; skipping endpoint check")
8791
return c.operatorClient.ApplyOperatorStatus(ctx, c.controllerInstanceName, applyoperatorv1.OperatorStatus())
8892
}
93+
klog.Infof("[debug-801] endpointCheckDisabledFunc returned false; will not skip endpoint check")
94+
} else {
95+
klog.Infof("[debug-801] endpointCheckDisabledFunc is nil; will not skip endpoint check")
8996
}
9097

9198
endpoints, err := c.endpointListFn()

0 commit comments

Comments
 (0)