Skip to content

Add KubeletConfigAccepted const in 'machineconfiguration/v1/types.go'#2853

Open
aksjadha wants to merge 1 commit into
openshift:masterfrom
aksjadha:OCPNODE-4040
Open

Add KubeletConfigAccepted const in 'machineconfiguration/v1/types.go'#2853
aksjadha wants to merge 1 commit into
openshift:masterfrom
aksjadha:OCPNODE-4040

Conversation

@aksjadha
Copy link
Copy Markdown

@aksjadha aksjadha commented May 20, 2026

Add a new KubeletConfigAccepted constant of type KubeletConfigStatusConditionType to replace the separate KubeletConfigSuccess and KubeletConfigFailure condition types with a single unified condition type.

KubeletConfig currently uses two separate condition types — Success and Failure — to report status. This deviates from Kubernetes conventions:

  • Standard practice uses a single condition type with Status: True/False to indicate outcome
  • Two separate types make it harder to query condition state — consumers must check both Success and Failure instead of reading one condition
  • On success, Status.Conditions.Type and Status.Conditions.Message both show "Success", which is redundant and less informative
status:
  Conditions:
    Message:               Success
    Status:                True
    Type:                  Success

Changes

  • Added KubeletConfigAccepted KubeletConfigStatusConditionType = "Accepted" constant.
    - Status: True, Type: Accepted — the KubeletConfig CR has been accepted successfully
    - Status: False, Type: Accepted — the KubeletConfig CR was rejected (reason in Message field)

  • Marked KubeletConfigSuccess and KubeletConfigFailure as deprecated with guidance to use KubeletConfigAccepted instead

Related

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@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 May 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

This PR adds a new condition type constant, KubeletConfigAccepted, to KubeletConfigStatusConditionType in the machine configuration API types and updates the documentation for KubeletConfigSuccess and KubeletConfigFailure to mark them deprecated in favor of using KubeletConfigAccepted with True/False. The change is limited to the const block in machineconfiguration/v1/types.go.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a new KubeletConfigAccepted constant to the types.go file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 PR modifies only types.go (constant and documentation changes), with no Ginkgo test files added or modified. Check for stable test names is not applicable.
Test Structure And Quality ✅ Passed PR contains no Ginkgo test code. The custom check for Ginkgo test quality is not applicable as this PR only adds constants and documentation to machineconfiguration/v1/types.go.
Microshift Test Compatibility ✅ Passed This PR adds a new KubeletConfigAccepted constant in machineconfiguration/v1/types.go with no new Ginkgo e2e tests. The check only applies to new tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only adds/modifies API type constants in types.go; no Ginkgo e2e tests are added, so SNO test compatibility check does not apply.
Topology-Aware Scheduling Compatibility ✅ Passed PR only modifies type definitions in machineconfiguration/v1/types.go—adds a constant and deprecates others. Contains no deployment manifests, operator code, controllers, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR only adds constant definitions and documentation comments to a types.go file with no function definitions, init(), main(), or stdout write operations.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR only modifies machineconfiguration/v1/types.go, a Go types definition file that contains API resource types and constants. No Ginkgo e2e tests were added or modified in this PR.
No-Weak-Crypto ✅ Passed PR adds only constant definitions and documentation for Kubernetes API condition types with no cryptographic operations, weak crypto, custom implementations, or token comparisons.
Container-Privileges ✅ Passed PR modifies only Go source code (types.go with constant definitions), not container/K8s manifests; no privileged configs, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation settings present.
No-Sensitive-Data-In-Logs ✅ Passed PR adds only constant definitions and documentation comments with no logging statements or sensitive data exposure.
Description check ✅ Passed The PR description clearly explains the motivation for adding KubeletConfigAccepted constant, describes the changes made, and references related work.

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

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

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-ci openshift-ci Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 20, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 2026

Hello @aksjadha! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 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 joelspeed 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

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 20, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 20, 2026

Hi @aksjadha. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

Comment thread machineconfiguration/v1/types.go Outdated
@ngopalak-redhat
Copy link
Copy Markdown
Contributor

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 26, 2026
@aksjadha aksjadha marked this pull request as ready for review June 3, 2026 08:00
@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 Jun 3, 2026
@openshift-ci openshift-ci Bot requested review from sinnykumari and yuqi-zhang June 3, 2026 08:00
@aksjadha
Copy link
Copy Markdown
Author

aksjadha commented Jun 3, 2026

/retest-required

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 3, 2026

@aksjadha: 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.

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

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants