New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrated scheduler
files server.go, node_label.go, csi.go, non_csi.go to structured logging
#105855
Migrated scheduler
files server.go, node_label.go, csi.go, non_csi.go to structured logging
#105855
Conversation
@shivanshu1333: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/wg structured-logging |
/cc @serathius |
using label to squash |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
@@ -96,7 +96,7 @@ func (pl *CSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v | |||
csiNode, err := pl.csiNodeLister.Get(node.Name) | |||
if err != nil { | |||
// TODO: return the error once CSINode is created by default (2 releases) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy to help here :)
@@ -188,7 +188,7 @@ func (pl *CSILimits) filterAttachableVolumes( | |||
} | |||
// If the PVC is invalid, we don't count the volume because | |||
// there's no guarantee that it belongs to the running predicate. | |||
klog.V(5).InfoS("Unable to look up PVC info", "PVC", fmt.Sprintf("%s/%s", pod.Namespace, pvcName)) | |||
klog.V(5).InfoS("Unable to look up PVC info", "pod", klog.KObj(pod), "PVC", klog.KRef(pod.Namespace, pvcName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check which key we are using in other parts of the source code? Is it PVC
or pvc
or the long name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PVC
is being used as a key in this file and other files as well, also in other migration PRs, these are the most commonly used keys (eg. PV, PVC).
return "", "" | ||
} | ||
|
||
storageClass, err := pl.scLister.Get(scName) | ||
if err != nil { | ||
klog.V(5).InfoS("Could not get StorageClass for PVC", "PVC", fmt.Sprintf("%s/%s", namespace, pvcName), "err", err) | ||
klog.V(5).InfoS("Could not get StorageClass for PVC", "storageClass", klog.KObj(storageClass), "PVC", klog.KObj(pvc), "err", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't storageClass
nil in this case? you have to build the klog.KRef
. Also check if storageClass
is the keyword we are using in other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, adding storage class here is wrong, thanks for pointing it out, fixed it.
Also, we don't need to add anything else as "PVC", fmt.Sprintf("%s/%s", namespace, pvcName)
is being replaced by "PVC", klog.KObj(pvc)
.
@@ -178,7 +178,7 @@ func newNonCSILimits( | |||
filter = cinderVolumeFilter | |||
volumeLimitKey = v1.ResourceName(volumeutil.CinderVolumeLimitKey) | |||
default: | |||
klog.ErrorS(errors.New("wrong filterName"), "Cannot create nonCSILimits plugin", "candidates", fmt.Sprintf("%v %v %v %v", ebsVolumeFilterType, gcePDVolumeFilterType, azureDiskVolumeFilterType, cinderVolumeFilterType)) | |||
klog.ErrorS(errors.New("wrong filterName"), "Cannot create nonCSILimits plugin", "ebsVolumeFilterType", ebsVolumeFilterType, "gcePDVolumeFilterType", gcePDVolumeFilterType, "azureDiskVolumeFilterType", azureDiskVolumeFilterType, "cinderVolumeFilterType", cinderVolumeFilterType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listing the types like this is useless. It should be
"candidates", []string{....}
But I'm also fine with not stating them at all. After all, this line is probably unreachable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, in that case just logging the error and messages
} else if parsedMaxVols <= 0 { | ||
klog.Error("Maximum PD volumes must be a positive value, using default") | ||
klog.ErrorS(nil, "Maximum PD volumes must be a positive value, using default") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's create an error for "maximum PD volumes is negative", and use the common message "Unable to parse maximum PD volumes value, using default"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure :)
/approve cancel |
/approve please squash |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, sanposhiho, shivanshu1333 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
using label to squash |
@alculquicondor lgtm removed due to new commits, do you mind adding it? |
/lgtm |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Migrate
cmd/kube-scheduler/app/server.go
,pkg/scheduler/framework/plugins/nodelabel/node_label.go
,pkg/scheduler/framework/plugins/nodevolumelimits/csi.go
,pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go
to structured loggingWhich issue(s) this PR fixes:
Ref #105841
Special notes for your reviewer:
Added missing migration points, fixed previously migrated logs
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: