Skip to content

Conversation

tkashem
Copy link
Contributor

@tkashem tkashem commented Sep 18, 2025

This PR cleans up the alpha/beta enablement key for DRA. #1932 sets the upper bound for beta to < 13.4.0

@tkashem tkashem changed the title enable resource v1beta2 api if DynamicResourceAllocation is enabled [WIP] enable resource v1beta2 api if DynamicResourceAllocation is enabled Sep 18, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 18, 2025
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2025
@tkashem
Copy link
Contributor Author

tkashem commented Sep 18, 2025

/hold

@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 Sep 18, 2025
@tkashem
Copy link
Contributor Author

tkashem commented Sep 18, 2025

Note: it's late for 4.20.0, but we should backport it to the next 4.20.z stream

/cherry-pick release-4.20

@openshift-cherrypick-robot

@tkashem: once the present PR merges, I will cherry-pick it on top of release-4.20 in a new PR and assign it to you.

In response to this:

Note: it's late for 4.20.0, but we should backport it to the next 4.20.z stream

/cherry-pick release-4.20

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.

@haircommander
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 23, 2025
@haircommander
Copy link
Member

@tkashem is this still WIP?

/skip

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 24, 2025
Copy link

coderabbitai bot commented Sep 24, 2025

Walkthrough

Removed the DynamicResourceAllocation entry from defaultGroupVersionsByFeatureGate in observe_runtime_config.go; VolumeAttributesClass remained unchanged aside from formatting. No exported/public API signatures were altered.

Changes

Cohort / File(s) Summary
Feature-gate runtime config mapping
pkg/operator/configobservation/apienablement/observe_runtime_config.go
Deleted the DynamicResourceAllocation mapping (removed resource.k8s.io per-version entries across OpenShift/Kubernetes version ranges). VolumeAttributesClass retained; visible differences are formatting only. No other edits.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title directly references the core change of removing beta enablement for the resource API and corresponds to the modifications in the code that drop v1beta1 support for DynamicResourceAllocation. It is concise, specific, and omits extraneous details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed The PR description concisely describes the cleanup of the alpha/beta enablement key for DynamicResourceAllocation and references the relevant upstream PR that sets the beta upper bound. This aligns directly with the changeset, which removes the DynamicResourceAllocation entry from defaultGroupVersionsByFeatureGate. The description is on-topic and directly reflects the modifications made.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2025
Copy link

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6333489 and dc3a99f.

📒 Files selected for processing (1)
  • pkg/operator/configobservation/apienablement/observe_runtime_config.go (1 hunks)

Comment on lines 18 to 32
var defaultGroupVersionsByFeatureGate = map[configv1.FeatureGateName][]groupVersionByOpenshiftVersion{
"ValidatingAdmissionPolicy": {{GroupVersion: schema.GroupVersion{Group: "admissionregistration.k8s.io", Version: "v1beta1"}}},
"DynamicResourceAllocation": {
{KubeVersionRange: semver.MustParseRange("< 1.31.0"), GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1alpha2"}},
{KubeVersionRange: semver.MustParseRange(">= 1.31.0"), GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1alpha3"}},
{KubeVersionRange: semver.MustParseRange(">= 1.32.0"), GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1beta1"}},
},
"VolumeAttributesClass": {{GroupVersion: schema.GroupVersion{Group: "storage.k8s.io", Version: "v1beta1"}}},
"VolumeAttributesClass": {{GroupVersion: schema.GroupVersion{Group: "storage.k8s.io", Version: "v1beta1"}}},
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

🧩 Analysis chain

Re-add DynamicResourceAllocation mapping (enable resource.k8s.io/v1beta2) — current code can’t fulfill the PR objective

Without an entry for DynamicResourceAllocation here, RuntimeConfigFromFeatureGates will never emit resource.k8s.io/v1beta2=true, so the API won’t be enabled when the FG is set.

Apply this diff to gate v1beta2 on Kubernetes 1.33+:

 var defaultGroupVersionsByFeatureGate = map[configv1.FeatureGateName][]groupVersionByOpenshiftVersion{
   "ValidatingAdmissionPolicy": {{GroupVersion: schema.GroupVersion{Group: "admissionregistration.k8s.io", Version: "v1beta1"}}},
+  "DynamicResourceAllocation": {
+    {GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1beta2"}, KubeVersionRange: semver.MustParseRange(">=1.33.0")},
+  },
   "VolumeAttributesClass":     {{GroupVersion: schema.GroupVersion{Group: "storage.k8s.io", Version: "v1beta1"}}},
 }

If we still support earlier Kubernetes minors in this branch, consider adding a non-overlapping fallback (e.g., v1beta1 with <1.33.0) to avoid emitting multiple versions for the same group.

Run to verify usage and whitelist coverage:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Searching for DynamicResourceAllocation references (whitelist/blacklist, observers, tests)..."
rg -n -C3 '\bDynamicResourceAllocation\b'

echo
echo "Where is GetDefaultGroupVersionByFeatureGate used?"
rg -n -C3 '\bGetDefaultGroupVersionByFeatureGate\b'

echo
echo "Any other resource.k8s.io version toggles to keep consistent?"
rg -n -C3 'resource\.k8s\.io'

Length of output: 14615


Re-add DynamicResourceAllocation mapping (enable resource.k8s.io/v1beta2)

defaultGroupVersionsByFeatureGate in pkg/operator/configobservation/apienablement/observe_runtime_config.go omits DynamicResourceAllocation, so RuntimeConfigFromFeatureGates will never emit resource.k8s.io/v1beta2=true when the feature gate is set — add:

 var defaultGroupVersionsByFeatureGate = map[configv1.FeatureGateName][]groupVersionByOpenshiftVersion{
   "ValidatingAdmissionPolicy": {{GroupVersion: schema.GroupVersion{Group: "admissionregistration.k8s.io", Version: "v1beta1"}}},
+  "DynamicResourceAllocation": {
+    {GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1beta2"}, KubeVersionRange: semver.MustParseRange(">=1.33.0")},
+  },
   "VolumeAttributesClass":     {{GroupVersion: schema.GroupVersion{Group: "storage.k8s.io", Version: "v1beta1"}}},
 }

If older Kubernetes minors are supported in this branch, add a non‑overlapping fallback (e.g., older version with <1.33.0) to avoid emitting multiple versions for the same group.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var defaultGroupVersionsByFeatureGate = map[configv1.FeatureGateName][]groupVersionByOpenshiftVersion{
"ValidatingAdmissionPolicy": {{GroupVersion: schema.GroupVersion{Group: "admissionregistration.k8s.io", Version: "v1beta1"}}},
"DynamicResourceAllocation": {
{KubeVersionRange: semver.MustParseRange("< 1.31.0"), GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1alpha2"}},
{KubeVersionRange: semver.MustParseRange(">= 1.31.0"), GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1alpha3"}},
{KubeVersionRange: semver.MustParseRange(">= 1.32.0"), GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1beta1"}},
},
"VolumeAttributesClass": {{GroupVersion: schema.GroupVersion{Group: "storage.k8s.io", Version: "v1beta1"}}},
"VolumeAttributesClass": {{GroupVersion: schema.GroupVersion{Group: "storage.k8s.io", Version: "v1beta1"}}},
}
var defaultGroupVersionsByFeatureGate = map[configv1.FeatureGateName][]groupVersionByOpenshiftVersion{
"ValidatingAdmissionPolicy": {{GroupVersion: schema.GroupVersion{Group: "admissionregistration.k8s.io", Version: "v1beta1"}}},
"DynamicResourceAllocation": {
{GroupVersion: schema.GroupVersion{Group: "resource.k8s.io", Version: "v1beta2"}, KubeVersionRange: semver.MustParseRange(">=1.33.0")},
},
"VolumeAttributesClass": {{GroupVersion: schema.GroupVersion{Group: "storage.k8s.io", Version: "v1beta1"}}},
}

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2025
@tkashem
Copy link
Contributor Author

tkashem commented Sep 24, 2025

@haircommander i have made changes, let me know your thoughts:

  • in 4.21 (1.34) DRA is GA with v1, and the beta apis are disabled by default. So for 4.21 i think we don't need to enable the beta apis. This PR now removes enablement of the beta apis starting with 4.21 (assuming that we don't have to GA DRA in 4.20.z for AI conformance)
  • for 4.20, DRA is in {tech|dev}preview, and we want to enable v1beta2 (introduced in 1.33) in 4.20.z. OCPNODE-3757: enable resource v1beta2 api if DynamicResourceAllocation is enabled #1929

@tkashem tkashem changed the title [WIP] enable resource v1beta2 api if DynamicResourceAllocation is enabled enable resource v1beta2 api if DynamicResourceAllocation is enabled Sep 24, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 24, 2025
@haircommander
Copy link
Member

SGTM!

/lgtm

(BTW, the title needs to be updated)

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 24, 2025
Copy link
Contributor

openshift-ci bot commented Sep 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, tkashem

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

The pull request process is described here

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

@tkashem tkashem changed the title enable resource v1beta2 api if DynamicResourceAllocation is enabled remove beta enablement for resource api Sep 26, 2025
@benluddy
Copy link
Contributor

/assign

@tkashem tkashem changed the title remove beta enablement for resource api OCPNODE-3758: remove beta enablement for resource api Sep 29, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 29, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 29, 2025

@tkashem: This pull request references OCPNODE-3758 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

In response to this:

DynamicResourceAllocation is in GA with resource.k8s.io/v1 apis in 1.34. we enabled v1beta1 api for DynamicResourceAllocation in tech or dev preview in 4.20 and previous versions. we don't support upgrade from a tech/dev preview cluster, so we don't have to carry the burden of supporting beta apis.

we should not support beta apis from 4.20

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.

@tkashem tkashem changed the title OCPNODE-3758: remove beta enablement for resource api OCPBUGS-62366: remove beta enablement for resource api Sep 29, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Sep 29, 2025
@openshift-ci-robot
Copy link

@tkashem: This pull request references Jira Issue OCPBUGS-62366, 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 (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @lyman9966

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

In response to this:

DynamicResourceAllocation is in GA with resource.k8s.io/v1 apis in 1.34. we enabled v1beta1 api for DynamicResourceAllocation in tech or dev preview in 4.20 and previous versions. we don't support upgrade from a tech/dev preview cluster, so we don't have to carry the burden of supporting beta apis.

we should not support beta apis from 4.20

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 openshift-ci bot requested a review from lyman9966 September 29, 2025 20:28
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 3, 2025
Copy link
Contributor

openshift-ci bot commented Oct 3, 2025

New changes are detected. LGTM label has been removed.

enable resource v1beta2 api if the DRA feature gate
DynamicResourceAllocation is enabled. v1beta2 has been added in 1.33
DynamicResourceAllocation is in GA with resource.k8s.io/v1 apis
in 1.34. we enabled beta apis for DynamicResourceAllocation
in tech or dev preview in 4.20 and previous versions.
enablement of alpha/beta apis is defunct with 4.21 and onward
Copy link
Contributor

openshift-ci bot commented Oct 4, 2025

@tkashem: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-operator-disruptive-single-node 71afb19 link false /test e2e-aws-operator-disruptive-single-node
ci/prow/e2e-gcp-operator-single-node 71afb19 link false /test e2e-gcp-operator-single-node
ci/prow/okd-scos-e2e-aws-ovn 71afb19 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-azure-ovn 71afb19 link false /test e2e-azure-ovn

Full PR test history. Your PR dashboard.

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.

@benluddy
Copy link
Contributor

benluddy commented Oct 5, 2025

Merging #1932 now, which should have the effect of disabling these GVs atomically with the merge of the 1.34 openshift/kubernetes rebase. Later, we can resume this PR to clean up the then-inert GV entries.

@openshift-ci-robot
Copy link

@tkashem: This pull request references Jira Issue OCPBUGS-62366, which is valid.

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

Requesting review from QA contact:
/cc @lyman9966

In response to this:

This PR cleans up the alpha/beta enablement keys
#1932 sets the upper bound for beta to < 13.4.0

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.

@tkashem
Copy link
Contributor Author

tkashem commented Oct 8, 2025

/hold

(rebase may be necessary after #1932 merges)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants