Skip to content

fix(yurtappset): add StatefulSet watch to reconcile StatefulSet-based workloads - #2788

Open
AruneshDwivedi wants to merge 2 commits into
openyurtio:masterfrom
AruneshDwivedi:fix/yurtappset-missing-statefulset-watch-2777
Open

fix(yurtappset): add StatefulSet watch to reconcile StatefulSet-based workloads#2788
AruneshDwivedi wants to merge 2 commits into
openyurtio:masterfrom
AruneshDwivedi:fix/yurtappset-missing-statefulset-watch-2777

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

Fixes #2777

The YurtAppSet controller supports StatefulSetTemplate workloads but
was missing a Watch for appsv1.StatefulSet objects in add(). This meant
reconciler was not notified of StatefulSet mutations and would have
stale workload state.

Add a Watch for appsv1.StatefulSet with the same OnlyControllerOwner
predicate as the existing Deployment watch.

The getResponse function reads HTTP response headers into a bufio.Reader
and returns the parsed *http.Response whose Body still reads from the
underlying reader. Using a pooled reader and returning it to the pool
via defer before the response body is fully consumed causes a data race
when another goroutine reuses the same pooled reader.

Create a fresh bufio.Reader instead of using the pool to eliminate the
race condition.

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
… workloads

The YurtAppSet controller supports StatefulSetTemplate workloads but
was missing a Watch for appsv1.StatefulSet objects in add(). This meant
reconciler was not notified of StatefulSet mutations and would have
stale workload state.

Add a Watch for appsv1.StatefulSet with the same OnlyControllerOwner
predicate as the existing Deployment watch.

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
@AruneshDwivedi
AruneshDwivedi requested a review from a team as a code owner August 29, 2026 09:25
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Missing StatefulSet watch in YurtAppSet controller may cause stale reconciliation for StatefulSet-based workloads

1 participant