Skip to content

OCPBUGS-82584: Populate status label selector for scale subresource.#1490

Open
RadekManak wants to merge 2 commits intoopenshift:mainfrom
openshift-cloud-team:OCPBUGS-82584
Open

OCPBUGS-82584: Populate status label selector for scale subresource.#1490
RadekManak wants to merge 2 commits intoopenshift:mainfrom
openshift-cloud-team:OCPBUGS-82584

Conversation

@RadekManak
Copy link
Copy Markdown
Contributor

@RadekManak RadekManak commented Apr 16, 2026

Summary

MachineSet advertises a scale subresource with labelSelectorPath: .status.labelSelector, but the field is not present in the machineset status.

This PR:

  • vendors the corresponding openshift/api and openshift/client-go updates
  • populates status.labelSelector from spec.selector during MachineSet status reconciliation
  • adds focused unit coverage for selector formatting and selector-only status updates

This makes the MachineSet scale subresource expose the selector expected by HPA/KEDA-style scale consumers that rely on the Kubernetes scale contract.

Summary by CodeRabbit

  • New Features
    • MachineSet status now includes a serialized label selector and surfaces it via the scale subresource.
  • Tests
    • Added tests confirming label selector is computed into status and that status label selector updates persist.
  • Chores
    • Updated Go module dependency pins.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 16, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Apr 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@RadekManak: This pull request references Jira Issue OCPBUGS-82584, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

MachineSet advertises a scale subresource with labelSelectorPath: .status.labelSelector, but the field is not present in the machineset status.

This PR:

  • vendors the corresponding openshift/api and openshift/client-go updates
  • populates status.labelSelector from spec.selector during MachineSet status reconciliation
  • adds focused unit coverage for selector formatting and selector-only status updates

This makes the MachineSet scale subresource expose the selector expected by HPA/KEDA-style scale consumers that rely on the Kubernetes scale contract.

/hold for API PR merging

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Apr 16, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Walkthrough

Updated Go module dependency pins in go.mod. Added status.labelSelector (string) to five MachineSet CRD variants and wired it into the scale subresource. MachineSet status computation now sets and compares LabelSelector. Added tests validating selector calculation and status persistence.

Changes

Cohort / File(s) Summary
Module Dependencies
go.mod
Updated pinned versions for github.com/openshift/api and github.com/openshift/client-go in the require block (replaced older pseudo-version commits with newer ones). No other replace directives or module requirements changed.
MachineSet CRD Schema
install/0000_30_machine-api-operator_03_machineset.*.crd.yaml
install/0000_30_machine-api-operator_03_machineset.CustomNoUpgrade.crd.yaml, ...Default.crd.yaml, ...DevPreviewNoUpgrade.crd.yaml, ...OKD.crd.yaml, ...TechPreviewNoUpgrade.crd.yaml
Added status.labelSelector (type: string, minLength: 1, maxLength: 4096) and descriptive docs to each MachineSet CRD variant. Updated subresources.scale to include labelSelectorPath: .status.labelSelector so the scale subresource exposes the selector.
Status Computation Logic
pkg/controller/machineset/status.go
Set newStatus.LabelSelector from ms.Spec.Selector (formatted via metav1); include LabelSelector in the status equality check to avoid no-op patches; simplified status logging and removed unused fmt usage.
Status Tests
pkg/controller/machineset/status_test.go
Added tests: TestMachineSetStatusLabelSelectorMatchesScaleSubresource verifies serialized selector equals metav1.FormatLabelSelector(&ms.Spec.Selector) for label and expression selectors; TestUpdateMachineSetStatusUpdatesLabelSelectorWithoutReplicaChanges verifies updating only status.LabelSelector persists via the status subresource using a fake controller-runtime client.

Sequence Diagram(s)

sequenceDiagram
  participant Controller as Controller
  participant APIServer as API Server (CRD + scale subresource)
  participant etcd as Storage (etcd)
  Controller->>APIServer: GET MachineSet (spec.selector)
  Controller->>Controller: calculateStatus → status.LabelSelector (metav1.FormatLabelSelector)
  alt status changed (including LabelSelector)
    Controller->>APIServer: PATCH status (status.labelSelector, replicas, conditions)
    APIServer->>etcd: persist status
    APIServer-->>Controller: status updated
  else no change
    Controller-->>Controller: no-op (skip patch)
  end
  Note over APIServer,Controller: scale subresource reads status.labelSelector as status.selector
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Test code has good structure and follows codebase conventions, but two assertions lack meaningful failure messages. Add failure message text to assertions on lines 109 and 113 to provide context for debugging failures.
✅ Passed checks (10 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and specifically identifies the main change: populating the status label selector for the scale subresource in MachineSet, which is directly supported by the file changes across all modified CRD files and the status controller code.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All test names in status_test.go are stable and deterministic with no dynamic information.
Microshift Test Compatibility ✅ Passed The file contains standard Go unit tests using fake clients, not Ginkgo e2e tests, so the MicroShift compatibility check does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds only unit tests using controller-runtime fake client, not e2e tests. Tests validate label selector formatting and status persistence in isolation without multi-node or HA cluster assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed Pull request introduces only additive changes to MachineSet CRD and controller to expose status.labelSelector field; no scheduling constraints, topology assumptions, or operational behavior modifications are introduced.
Ote Binary Stdout Contract ✅ Passed PR modifications do not introduce violations of OTE Binary Stdout Contract. New status_test.go contains only standard unit tests; status.go uses klog properly configured to stderr.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The pull request adds standard Go unit tests using the testing package, not Ginkgo e2e tests. The tests do not make IPv4-specific assumptions, hardcode IPv4 addresses, or require external connectivity.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from nrb and theobarberbany April 16, 2026 10:12
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign racheljpg for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@RadekManak
Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@RadekManak: This pull request references Jira Issue OCPBUGS-82584, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@go.mod`:
- Around line 9-10: Remove the local replace overrides for the modules
referenced as github.com/openshift/api and github.com/openshift/client-go in
go.mod so the build uses the declared pseudo-versions; specifically delete the
replace directives that point those module names to local ../api and
../client-go paths so the go tool will resolve the versions already listed
(v0.0.0-20260326111139-30c2ef7a272e and v0.0.0-20260317180604-743f664b82d1).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0fb15324-6dea-45c5-81c5-be3d4c5c0796

📥 Commits

Reviewing files that changed from the base of the PR and between 498bb59 and 879bfcf.

⛔ Files ignored due to path filters (81)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/openshift/api/.golangci.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_authentication.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_dns.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_infrastructure.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/envtest-releases.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/etcd/install.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/etcd/v1/Makefile is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/etcd/v1/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/etcd/v1/register.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/etcd/v1/types_pacemakercluster.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/etcd/v1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/etcd/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/etcd/v1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/etcd/v1alpha1/types_pacemakercluster.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/etcd/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/features.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/features/features.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/zz_generated.crd-manifests/0000_10_machine-api_01_machinesets-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/types_ingress.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/types_network.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/quota/v1/generated.proto is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/quota/v1/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/quota/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/awsdnsspec.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/infrastructurestatus.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/prefixedclaimmapping.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1/usernameclaimmapping.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/alertmanagercustomconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/clustermonitoringspec.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/containerresource.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/metricsserverconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/openshiftstatemetricsconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatoradmissionwebhookconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/prometheusoperatorconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/telemeterclientconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/config/v1alpha1/thanosquerierconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/internal/internal.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/config/applyconfigurations/utils.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/machine/applyconfigurations/internal/internal.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetstatus.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/operator/applyconfigurations/internal/internal.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/awscsidriverconfigspec.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/bgpmanagedconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ingresscontrollertuningoptions.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/nooverlayconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/client-go/operator/applyconfigurations/operator/v1/ovnkubernetesconfig.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (8)
  • go.mod
  • install/0000_30_machine-api-operator_03_machineset.CustomNoUpgrade.crd.yaml
  • install/0000_30_machine-api-operator_03_machineset.Default.crd.yaml
  • install/0000_30_machine-api-operator_03_machineset.DevPreviewNoUpgrade.crd.yaml
  • install/0000_30_machine-api-operator_03_machineset.OKD.crd.yaml
  • install/0000_30_machine-api-operator_03_machineset.TechPreviewNoUpgrade.crd.yaml
  • pkg/controller/machineset/status.go
  • pkg/controller/machineset/status_test.go

Comment thread go.mod Outdated
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@RadekManak: This pull request references Jira Issue OCPBUGS-82584, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Summary

MachineSet advertises a scale subresource with labelSelectorPath: .status.labelSelector, but the field is not present in the machineset status.

This PR:

  • vendors the corresponding openshift/api and openshift/client-go updates
  • populates status.labelSelector from spec.selector during MachineSet status reconciliation
  • adds focused unit coverage for selector formatting and selector-only status updates

This makes the MachineSet scale subresource expose the selector expected by HPA/KEDA-style scale consumers that rely on the Kubernetes scale contract.

/hold for API PR merging

Summary by CodeRabbit

  • New Features
  • MachineSet status now includes a serialized label selector exposed via the scale subresource for autoscalers and other consumers.
  • Tests
  • Added tests verifying label selector computation and that status label selector updates persist.
  • Chores
  • Updated dependency pins.

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 openshift-eng/jira-lifecycle-plugin repository.

Set status.labelSelector from spec.selector on each reconcile so the
CRD scale subresource (labelSelectorPath: .status.labelSelector) can
expose the selector string to the HPA and other autoscalers via the
autoscaling/v1 Scale status.selector field.

Add tests verifying calculateStatus sets labelSelector correctly and
that updateMachineSetStatus writes the field even when replica counts
are unchanged.
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

@RadekManak: all tests passed!

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

@RadekManak
Copy link
Copy Markdown
Contributor Author

/hold cancel
API PR merged and this PR rebased. Ready for review.

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 4, 2026
@RadekManak
Copy link
Copy Markdown
Contributor Author

/verified by @RadekManak scaling machineset using VPA.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 4, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@RadekManak: This PR has been marked as verified by @radekmanak scaling machineset using VPA..

Details

In response to this:

/verified by @RadekManak scaling machineset using VPA.

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 openshift-eng/jira-lifecycle-plugin repository.

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

Labels

jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants