Skip to content

chore!: remove interval field from resource CR#2116

Merged
morri-son merged 4 commits into
open-component-model:mainfrom
frewilhelm:k8s-api-rm-res-interval-2
Mar 30, 2026
Merged

chore!: remove interval field from resource CR#2116
morri-son merged 4 commits into
open-component-model:mainfrom
frewilhelm:k8s-api-rm-res-interval-2

Conversation

@frewilhelm

@frewilhelm frewilhelm commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove the interval field from ResourceSpec and the GetRequeueAfter() method from the Resource type
  • Update the Resource and Deployer controllers to no longer requeue on a timer
  • Remove interval from the Resource CRD schema (base + Helm chart) and drop it from the required list
  • Clean up all tests, samples, examples, and documentation accordingly

Motivation

The interval field on the Resource API is redundant with the existing event-driven
reconciliation model. Unlike Repository and Component, the Resource controller does
not poll an external system directly. Its reconciliation is already triggered by:

  1. Spec changes — via the GenerationChangedPredicate on the Resource itself.
  2. Component updates — via a watch on the referenced Component object, which
    re-enqueues all Resources that reference it.
  3. Resolution completions — via the worker pool event source, which notifies
    the controller when an async resolution finishes.

The Component controller is the one that actually polls the OCM repository on its
own interval. When a new component version is discovered, the Component's status
update propagates through the watch chain: Component → Resource → Deployer. Adding
a separate polling interval on the Resource was therefore unnecessary overhead that
could also mask the true source of updates and make debugging harder.

Removing it makes the Resource controller purely reactive and aligns it with the
principle that only the outermost controllers (Repository, Component) that interact
with external systems should own polling intervals.


This is a replacement for #2091 (see comment)

Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
@frewilhelm frewilhelm requested a review from a team as a code owner March 30, 2026 07:45
@github-actions github-actions Bot added the size/s Small label Mar 30, 2026
@frewilhelm frewilhelm changed the title remove interval field from resource CR chore!: remove interval field from resource CR Mar 30, 2026
@github-actions github-actions Bot added !BREAKING-CHANGE! Breaking change in API or ocm-cli or spec kind/chore chore, maintenance, etc. labels Mar 30, 2026
@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Removes the Interval field from ResourceSpec and the associated GetRequeueAfter() method from the Resource type, eliminating explicit reconciliation interval configuration from resource specifications across CRD definitions, examples, test data, and controller implementations.

Changes

Cohort / File(s) Summary
API Type Definitions
kubernetes/controller/api/v1alpha1/resource_types.go
Deleted Interval metav1.Duration field from ResourceSpec with its kubebuilder annotation, and removed the GetRequeueAfter() method along with the time import.
Generated Code
kubernetes/controller/api/v1alpha1/zz_generated.deepcopy.go
Removed explicit Interval field assignment from autogenerated DeepCopyInto methods for ComponentSpec and ResourceSpec.
CRD Schemas
kubernetes/controller/chart/templates/crd/resources.delivery.ocm.software.yaml, kubernetes/controller/config/crd/bases/delivery.ocm.software_resources.yaml
Removed interval property definition and removed it from spec.required lists in both CRD schema files.
Controller Implementations
kubernetes/controller/internal/controller/deployer/deployer_controller.go, kubernetes/controller/internal/controller/resource/resource_controller.go
Changed requeue logic: replaced resource.GetRequeueAfter() calls with hardcoded 0 or removed requeue scheduling, now relying on event-driven reconciliation instead of periodic requeue.
Sample & Example Configurations
kubernetes/controller/config/samples/resource.delivery.ocm.software_sample.yaml, kubernetes/controller/examples/*/bootstrap.yaml, kubernetes/controller/examples/*/rgd.yaml
Removed spec.interval: 10m field from all Resource specifications across helm-, kustomize-, k8s-manifest-*, and applyset-pruning examples (17 files).
Documentation Examples
kubernetes/controller/docs/getting-started/deploy-helm-chart-bootstrap.md, kubernetes/controller/docs/getting-started/deploy-helm-chart.md
Removed interval: 1m fields from three ResourceGraphDefinition template examples.
Test Files
kubernetes/controller/internal/controller/deployer/deployer_controller_test.go, kubernetes/controller/internal/controller/resource/resource_controller_test.go
Removed Spec.Interval field assignments from test resource objects; deleted time import from resource controller test file.
Test Data
kubernetes/controller/test/e2e/testdata/*/bootstrap.yaml, kubernetes/controller/test/e2e/testdata/*/rgd.yaml
Removed spec.interval: 10m from Resource objects in basic-auth, docker-config-json test data (4 files).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

size/m, kind/feature

Suggested reviewers

  • Skarlso
  • jakobmoellerdev
  • fabianburth

Poem

🐰 A hop, a skip, intervals gone,
No more timed requeue, control lives on,
Event-driven now, swift and lean,
The cleanest Resource we've ever seen! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore!: remove interval field from resource CR' accurately and concisely describes the main change: removing the interval field from the Resource Custom Resource.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description directly addresses the changeset, explaining the removal of the interval field and requeue logic from Resource types and controllers.

✏️ 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.

@morri-son morri-son enabled auto-merge (squash) March 30, 2026 08:14
@morri-son morri-son merged commit 4e2a23c into open-component-model:main Mar 30, 2026
20 checks passed
frewilhelm added a commit that referenced this pull request Mar 30, 2026
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

Update the resource API in the conformance tests

#### Which issue(s) this PR fixes

Follow up for
#2116

Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
morri-son pushed a commit to open-component-model/ocm-website that referenced this pull request Mar 30, 2026
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

Upate resource API `interval` and `skipVerify`. Found a duplicated guide
in `How-To` and `Tutorials` about configuring credentials for the
ocm-k8s-toolkit. I kept the How-To because the guide itself is pretty
short


#### Which issue(s) this PR is related to

Related to
open-component-model/open-component-model#2116

#### Type of content
<!--
Which section does this PR target? See CONTRIBUTING.md for guidance.
-->
- [ ] Tutorial (`getting-started/` or `tutorials/`)
- [ ] How-to Guide (`how-to/`)
- [ ] Explanation / Concept (`concepts/`)
- [ ] Reference (`reference/`)
- [x] Other (infrastructure, config, fixes)

#### Checklist

- [x] I have read and followed the [Contributing
Guide](https://github.com/open-component-model/ocm-website/blob/main/CONTRIBUTING.md)
- [x] All commands/code snippets are tested and can be copy-pasted

---------

Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
ocmbot Bot pushed a commit to open-component-model/ocm-website that referenced this pull request Mar 30, 2026
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

Upate resource API `interval` and `skipVerify`. Found a duplicated guide
in `How-To` and `Tutorials` about configuring credentials for the
ocm-k8s-toolkit. I kept the How-To because the guide itself is pretty
short

#### Which issue(s) this PR is related to

Related to
open-component-model/open-component-model#2116

#### Type of content
<!--
Which section does this PR target? See CONTRIBUTING.md for guidance.
-->
- [ ] Tutorial (`getting-started/` or `tutorials/`)
- [ ] How-to Guide (`how-to/`)
- [ ] Explanation / Concept (`concepts/`)
- [ ] Reference (`reference/`)
- [x] Other (infrastructure, config, fixes)

#### Checklist

- [x] I have read and followed the [Contributing
Guide](https://github.com/open-component-model/ocm-website/blob/main/CONTRIBUTING.md)
- [x] All commands/code snippets are tested and can be copy-pasted

---------

Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com> ea2485c
@frewilhelm frewilhelm deleted the k8s-api-rm-res-interval-2 branch March 30, 2026 11:55
morri-son pushed a commit to jakobmoellerdev/ocm-website that referenced this pull request Apr 10, 2026
…t-model#792)

<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

Upate resource API `interval` and `skipVerify`. Found a duplicated guide
in `How-To` and `Tutorials` about configuring credentials for the
ocm-k8s-toolkit. I kept the How-To because the guide itself is pretty
short

#### Which issue(s) this PR is related to

Related to
open-component-model/open-component-model#2116

#### Type of content
<!--
Which section does this PR target? See CONTRIBUTING.md for guidance.
-->
- [ ] Tutorial (`getting-started/` or `tutorials/`)
- [ ] How-to Guide (`how-to/`)
- [ ] Explanation / Concept (`concepts/`)
- [ ] Reference (`reference/`)
- [x] Other (infrastructure, config, fixes)

#### Checklist

- [x] I have read and followed the [Contributing
Guide](https://github.com/open-component-model/ocm-website/blob/main/CONTRIBUTING.md)
- [x] All commands/code snippets are tested and can be copy-pasted

---------

Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Apr 14, 2026
…e event buffer

When a worker pool resolution event is dropped (non-blocking channel
send, buffer full), controllers stuck permanently in ResolutionInProgress
because return ctrl.Result{}, nil has no fallback requeue. This became
fatal after removing the interval field from Resource CRs (PR open-component-model#2116).

Changes:
- Add RequeueAfter: 30s on all ResolutionInProgress return paths in
  resource, component, and deployer controllers as safety net
- Increase subscriber channel buffer from 10 to 100 to reduce drop
  probability
- Deployer now propagates ErrResolutionInProgress to caller for proper
  RequeueAfter handling

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!BREAKING-CHANGE! Breaking change in API or ocm-cli or spec kind/chore chore, maintenance, etc. size/s Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants