Skip to content

Commit 296b373

Browse files
authored
Ignore SysctlChanged condition when using kf doctor (#1106)
<!-- Include the issue number below --> ## Fixes Current pipelines that fail for no reason, see #1105 ## Proposed Changes * Fixes `kf doctor` reporting status `FAIL` when diagnosing perfectly fine nodes by ignoring specific `SysctlChanged` condition. ## Release Notes <!-- kf follows the Keep A Changelog standard for release notes. https://keepachangelog.com/en/1.0.0/ Changelog entries should be one per line and start with one of the following words: `Added` for new features. `Changed` for changes in existing functionality. `Deprecated` for soon-to-be removed features. `Removed` for now removed features. `Fixed` for any bug fixes. `Security` in case of vulnerabilities. If one of the changes is breaking include that as a second word e.g. Removed BREAKING support for manifests v1 --> ```release-note `Fixed` `kf doctor` reporting FAIL on node conditions despite node being healthly ```
1 parent ae0b8bf commit 296b373

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

pkg/kf/doctor/cluster.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,11 @@ func diagnoseDaemonSets(ctx context.Context, d *Diagnostic, kubernetes kubernete
422422
}
423423
}
424424

425+
func conditionShouldBeIgnored(condition corev1.NodeCondition) bool {
426+
shouldIgnore := condition.Type == "SysctlChanged" && condition.Status != corev1.ConditionFalse && condition.Message == "{\"unmanaged\": {\"kernel.cad_pid\": \"1\"}}"
427+
return shouldIgnore
428+
}
429+
425430
func diagnoseNodes(ctx context.Context, d *Diagnostic, kubernetes kubernetes.Interface) {
426431
nodesList, err := kubernetes.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
427432
switch {
@@ -501,9 +506,9 @@ func diagnoseNodes(ctx context.Context, d *Diagnostic, kubernetes kubernetes.Int
501506
)
502507
}
503508
default:
504-
// Other conditions on the node should be false because they
505-
// indicate specific failure conditions when set to true.
506-
if cond.Status != corev1.ConditionFalse {
509+
// Other conditions on the node should be false (unless known issue)
510+
// because they indicate specific failure conditions when set to true.
511+
if cond.Status != corev1.ConditionFalse && !conditionShouldBeIgnored(cond) {
507512
d.Errorf(
508513
"Condition %s is not healthy, current status is %q with message %q",
509514
cond.Type,

0 commit comments

Comments
 (0)