Skip to content

Show most relevant message in TigeraStatus kubectl output - #4651

Merged
caseydavenport merged 15 commits into
tigera:masterfrom
caseydavenport:casey-status-message
Sep 2, 2026
Merged

Show most relevant message in TigeraStatus kubectl output#4651
caseydavenport merged 15 commits into
tigera:masterfrom
caseydavenport:casey-status-message

Conversation

@caseydavenport

@caseydavenport caseydavenport commented Apr 7, 2026

Copy link
Copy Markdown
Member

Adds a top-level message to TigeraStatus and points the kubectl get tigerastatus MESSAGE column at it instead of the Degraded condition message. Previously the column only showed content when the component was degraded, so warnings and rollout detail needed -o yaml to see.

The message picks the most actionable thing available, in order:

  1. the degraded message, if degraded
  2. the progressing message, if progressing
  3. any warnings
  4. empty

The degraded message keeps a column of its own under -o wide, so it stays available on a version skew in either direction.

Example output when a component has a warning but is otherwise healthy:

NAME     AVAILABLE   PROGRESSING   DEGRADED   SINCE   MESSAGE
calico   True        False         False      5m      DaemonSet "calico-system/calico-node" has the unsupported ignore annotation; the operator is not managing this resource

Example output during rollout:

NAME     AVAILABLE   PROGRESSING   DEGRADED   SINCE   MESSAGE
calico   False       True          False      30s     DaemonSet "calico-system/calico-node" update is rolling out (2 out of 3 updated)
None

…Issues

Wire diagnosePods and summarizeIssues into syncState, replacing the
old podsFailing/containerErrorMessage functions. Each workload type
now reports not-found as a degraded condition instead of silently
continuing. DaemonSets and Deployments pass revision info so
diagnosePods can distinguish old-revision pods from current ones.
When an object has the unsupported.operator.tigera.io/ignore annotation,
surface a warning through TigeraStatus so users know the operator is not
managing the resource. Clear the warning if the annotation is later removed.
…applied

When the render package applies probe timing or resource overrides to a
workload, set an operator.tigera.io/custom-overrides annotation with a
comma-separated list of which override types were applied. This will be
used by diagnosePods to correlate pod failures with user overrides.
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 60 days with no activity.

@github-actions github-actions Bot added the stale label Jun 7, 2026
@radTuti radTuti modified the milestones: v1.43.0, v1.44.0 Jun 12, 2026
@github-actions github-actions Bot removed the stale label Jun 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 60 days with no activity.

@github-actions github-actions Bot added the stale label Aug 12, 2026
@danudey danudey modified the milestones: v1.44.0, v1.45.0 Aug 17, 2026
@github-actions github-actions Bot removed the stale label Aug 18, 2026

@electricjesus electricjesus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks pretty solid to me! a few comments inline.

Two process bits. It needs a rebase, it's conflicting on master now, and createOrUpdateObject grew an installationSpec arg since you branched. CI has also never run here, only the CLA check, so none of this has a green signal yet.

Also worth saying out loud for anyone else reading: GitHub shows 8 files because #4649 was squash merged, so the merge base predates it. The change here is really the one commit.

Comment thread pkg/controller/status/status.go Outdated
Comment thread pkg/controller/status/status.go
Comment thread api/v1/tigerastatus_types.go
Comment thread pkg/controller/status/status.go Outdated
An older CRD has no message field, so the read-back cannot tell us what we set. The status manager tracks the last message it wrote instead.

@electricjesus electricjesus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copilot AI lite review requested due to automatic review settings September 1, 2026 23:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new optional API field does not follow the repo’s “optional fields are pointers” convention, and the statusMessage() helper currently violates its own locking contract unless refactored as suggested.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR improves the usability of kubectl get tigerastatus by introducing a top-level .status.message field that surfaces the most relevant, actionable message (degraded > progressing > warnings > empty) in the default table output, while keeping degraded details available via a separate wide column for skew compatibility.

Changes:

  • Add .status.message to the TigeraStatus API/CRD and point the default kubectl printcolumn “Message” at it; rename the old degraded “Message” column to “Error” (wide only).
  • Compute and persist the new top-level status message in the status manager, collapsing multi-line condition messages to a single line for table output.
  • Add unit tests covering message precedence, newline collapsing, and behavior under CRD skew (message pruning).
File summaries
File Description
pkg/imports/crds/operator/operator.tigera.io_tigerastatuses.yaml Updates CRD schema/printcolumns to add .status.message and introduce a wide-only “Error” column for degraded condition messages.
pkg/controller/status/status.go Computes and writes Status.Message, adds pruning-skew handling via lastMessage, and collapses multi-line condition messages for kubectl output.
pkg/controller/status/status_test.go Adds tests for .status.message precedence, formatting, and pruning-skew behavior.
api/v1/tigerastatus_types.go Adds the Message field to the Go API type and updates kubebuilder printcolumns accordingly.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1199 to +1201
// Set the top-level Message field based on the most actionable condition.
ts.Status.Message = m.statusMessage(ts.Status.Conditions)

Comment on lines +1315 to +1329
// statusMessage returns the most actionable message for the top-level Message field,
// based on the current conditions. Priority: degraded > progressing > warnings > empty.
func (m *statusManager) statusMessage(conditions []operator.TigeraStatusCondition) string {
for _, c := range conditions {
if c.Type == operator.ComponentDegraded && c.Status == operator.ConditionTrue {
return singleLine(c.Message)
}
}
for _, c := range conditions {
if c.Type == operator.ComponentProgressing && c.Status == operator.ConditionTrue {
return singleLine(c.Message)
}
}
return m.warningMessageLocked()
}
Comment on lines +37 to +41
// Message is a human-readable summary of the component's current state: the degraded
// message if degraded, the progressing message if progressing, then any warnings.
// Empty when healthy with no warnings.
// +optional
Message string `json:"message,omitempty"`
@caseydavenport
caseydavenport merged commit 92781d5 into tigera:master Sep 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants