Skip to content

Commit 48ecf3c

Browse files
committed
WIP: debug
Signed-off-by: Peter Hunt <[email protected]>
1 parent 4dada5e commit 48ecf3c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

openshift-kube-apiserver/authorization/minimumkubeletversion/minimum_kubelet_version.go

+9
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func NewMinimumKubeletVersion(minVersion *semver.Version,
4747

4848
func (m *minimumKubeletVersionAuth) Authorize(ctx context.Context, attrs authorizer.Attributes) (authorizer.Decision, string, error) {
4949
if m.minVersion == nil {
50+
klog.Infof("XXXXXXXX not enabled %v", attrs.GetUser())
5051
return authorizer.DecisionNoOpinion, "", nil
5152
}
5253

@@ -57,34 +58,42 @@ func (m *minimumKubeletVersionAuth) Authorize(ctx context.Context, attrs authori
5758
switch requestResource {
5859
case api.Resource("nodes"):
5960
if v := attrs.GetVerb(); v == "get" || v == "update" {
61+
klog.Infof("XXXXXXXX nodes %v", attrs.GetUser())
6062
return authorizer.DecisionNoOpinion, "", nil
6163
}
6264
case authorizationv1.Resource("subjectaccessreviews"):
65+
klog.Infof("XXXXXXXX SAR %v", attrs.GetUser())
6366
return authorizer.DecisionNoOpinion, "", nil
6467
}
6568
}
6669

6770
nodeName, isNode := m.nodeIdentifier.NodeIdentity(attrs.GetUser())
6871
if !isNode {
72+
klog.Infof("XXXXXXXX not a node %v", attrs.GetUser())
6973
// ignore requests from non-nodes
7074
return authorizer.DecisionNoOpinion, "", nil
7175
}
7276

7377
if !m.hasNodeInformerSyncedFn() {
78+
klog.Infof("XXXXXXXX not synced %v", attrs.GetUser())
7479
return authorizer.DecisionDeny, "", fmt.Errorf("node informer not synced, cannot check if node %s is new enough", nodeName)
7580
}
7681

7782
node, err := m.nodeLister.Get(nodeName)
7883
if err != nil {
84+
klog.Infof("XXXXXXXX failed to get %v", attrs.GetUser())
7985
return authorizer.DecisionDeny, "", err
8086
}
8187

8288
if err := nodelib.IsNodeTooOld(node, m.minVersion); err != nil {
8389
if errors.Is(err, nodelib.ErrKubeletOutdated) {
90+
klog.Infof("XXXXXXXX outdated %v", attrs.GetUser())
8491
return authorizer.DecisionDeny, err.Error(), nil
8592
}
93+
klog.Infof("XXXXXXXX other err %v", attrs.GetUser())
8694
return authorizer.DecisionDeny, "", err
8795
}
8896

97+
klog.Infof("XXXXXXXX success %v", attrs.GetUser())
8998
return authorizer.DecisionNoOpinion, "", nil
9099
}

0 commit comments

Comments
 (0)