Skip to content

Commit

Permalink
UPSTREAM: <carry>: set correctly static pods CPUs when workload parti…
Browse files Browse the repository at this point in the history
…tioning is disabled

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
  • Loading branch information
Artyom Lukianov committed Jan 23, 2022
1 parent 06791f6 commit aa87520
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/kubelet/cm/cpumanager/cpu_manager.go
Expand Up @@ -396,14 +396,15 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec
failure = []reconciledContainer{}

m.removeStaleState()
workloadEnabled := managed.IsEnabled()
for _, pod := range m.activePods() {
pstatus, ok := m.podStatusProvider.GetPodStatus(pod.UID)
if !ok {
klog.V(4).InfoS("ReconcileState: skipping pod; status not found", "pod", klog.KObj(pod))
failure = append(failure, reconciledContainer{pod.Name, "", ""})
continue
}
if enabled, _, _ := managed.IsPodManaged(pod); enabled {
if enabled, _, _ := managed.IsPodManaged(pod); workloadEnabled && enabled {
klog.V(4).InfoS("[cpumanager] reconcileState: skipping pod; pod is managed (pod: %s)", pod.Name)
continue
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kubelet/managed/managed.go
Expand Up @@ -62,8 +62,8 @@ func IsEnabled() bool {
return pinnedManagementEnabled
}

/// IsPodManaged returns true and the name of the workload if enabled.
/// returns true, workload name, and the annotation payload.
// IsPodManaged returns true and the name of the workload if enabled.
// returns true, workload name, and the annotation payload.
func IsPodManaged(pod *v1.Pod) (bool, string, string) {
if pod.ObjectMeta.Annotations == nil {
return false, "", ""
Expand Down

0 comments on commit aa87520

Please sign in to comment.