NO-ISSUE: Fixes KubeletConfig API doc and adds tests
This PR improves the documentation for the KubeletConfigSpec API to make it more accurate and user-friendly. The focus is AutoSizingReserved. I have ignored adding the tests and the validation for TLSSecurityProfile. Also I haven't added the kubebuilder validation for LogLevel. They can be done in a different PR as this one focusses on API doc only.
Fixes the doc: https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html/machine_apis/kubeletconfig-machineconfiguration-openshift-io-v1#spec-4
It also adds test coverage similar to the pattern established in https://github.com/openshift/api/pull/2370.
AutoSizingReserved will default to true from 4.21 onwards. The default value and the description was not documented until now.
Test Coverage
Created test file: machineconfiguration/v1/tests/kubeletconfigs.machineconfiguration.openshift.io/KubeletConfigSpec.yaml
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
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
📝 Walkthrough
Walkthrough
Adds a YAML test suite for the KubeletConfig CRD covering onCreate and onUpdate scenarios (single-field, multi-field, and invalid-value cases). Adds two optional fields to KubeletConfigSpec: AutoSizingReserved (*bool) and LogLevel (*int32) with validation (0–10). Updates generated Swagger/docs and the CRD: clarifies kubeletConfig and machineConfigPoolSelector descriptions, expands logLevel and tlsSecurityProfile descriptions, and adds x-kubernetes-validations to restrict tlsSecurityProfile to Old and Intermediate.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly identifies the main change: documentation fixes for KubeletConfig API and addition of test coverage. |
| Description check | ✅ Passed | The description is directly related to the changeset, explaining the motivation for documentation improvements and test additions, including details about breaking changes. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- [ ] 📝 Generate docstrings
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
🔧 golangci-lint (2.5.0)
Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented
Comment @coderabbitai help to get the list of available commands and usage tips.
Hello @ngopalak-redhat! 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.
/test all
[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.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@coderabbitai review
✅ Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
@ngopalak-redhat: This pull request explicitly references no jira issue.
In response to this:
This PR improves the documentation for the KubeletConfigSpec API to make it more accurate and user-friendly. The focus is AutoSizingReserved. I have ignored adding the tests and the validation for TLSSecurityProfile. Also I haven't added the kubebuilder validation for LogLevel. They can be done in a different PR as this one focusses on API doc only.
It also adds test coverage similar to the pattern established in https://github.com/openshift/api/pull/2370.
AutoSizingReserved will default to true from 4.21 onwards. The default value and the description was not documented until now.
Test Coverage
Created test file: machineconfiguration/v1/tests/kubeletconfigs.machineconfiguration.openshift.io/KubeletConfigSpec.yaml
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.
cc: @haircommander @sairameshv
Thank you for the PR, I have a bunch of improvements sggested.
Please note that we need to add integration tests for the new validations.
@saschagrunert I made the code changes as suggested. I also added the validations and tests to machineconfiguration/v1/tests/kubeletconfigs.machineconfiguration.openshift.io/KubeletConfigSpec.yaml.
Are these the integration tests you were referring to?
@saschagrunert Thanks for the review. I have addressed your comments. Could you take another look? I also replied to the specific discussion here: https://github.com/openshift/api/pull/2651#discussion_r2726866363
@ngopalak-redhat: The following test 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/verify-crdify | 1b89d6b1e921d9f20918b56e964e46b883a1752f | link | true | /test verify-crdify |
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.