Skip to content

Rename ReleaseBinding to ComponentReleaseBinding - #4072

Closed
kavix wants to merge 1 commit into
openchoreo:mainfrom
kavix:rename-releasebinding-3728
Closed

kavix wants to merge 1 commit into
openchoreo:mainfrom
kavix:rename-releasebinding-3728

Conversation

@kavix

@kavix kavix commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Overview

Following the naming alignment discussion in #3347 ({Thing} + {Thing}Type -> {Thing}Release -> {Thing}ReleaseBinding), this Pull Request introduces the ComponentReleaseBinding Custom Resource (CRD) and implements a side-by-side deprecation strategy for the legacy ReleaseBinding CRD.

Closes #3728

Contribution / Migration Guide

1. Custom Resource Definitions (CRDs)

  • New CRD: ComponentReleaseBinding (api/v1alpha1/componentreleasebinding_types.go).
  • Deprecation: ReleaseBinding is now officially deprecated.
  • Compatibility: Both controllers run side-by-side. The legacy reconciler automatically marks existing ReleaseBinding resources with a deprecation condition (ConditionDeprecated) in their status, informing developers to migrate.

2. Templating & Resource Contexts

The template rendering contexts have been updated to align with the new resource structure:

  • In ComponentType rendering (ComponentContext), environment-specific parameters previously fetched from ReleaseBinding are now resolved via ComponentReleaseBinding.Spec.ComponentTypeEnvironmentConfigs.
  • In Trait rendering (TraitContext), overrides previously referenced via ReleaseBinding.Spec.TraitEnvironmentConfigs are now resolved via ComponentReleaseBinding.Spec.TraitEnvironmentConfigs.
  • See updated context schemas in docs/templating/context.md and docs/resource-kind-reference-guide.md.

3. OpenChoreo API & CLI

  • CLI (occ): Legacy occ releasebinding commands are marked as deprecated (using Cobra's .Deprecated feature). The new commands under occ componentreleasebinding (and short alias occ crb) are now active.
  • HTTP API: Legacy /releasebindings endpoints are marked as deprecated in handlers/spec; new /componentreleasebindings endpoints are registered.

4. Ecosystem & Verification

  • All sample templates (samples/), documentation files, and E2E test suites (test/e2e/suites/) have been fully migrated to use ComponentReleaseBinding.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4e7903d4-4557-4132-b945-f027d4ab1aa1

📥 Commits

Reviewing files that changed from the base of the PR and between 92180ef and 4faf174.

⛔ Files ignored due to path filters (6)
  • api/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated.*
  • config/crd/bases/openchoreo.dev_componentreleasebindings.yaml is excluded by !config/crd/bases/**
  • config/crd/bases/openchoreo.dev_releasebindings.yaml is excluded by !config/crd/bases/**
  • internal/openchoreo-api/api/gen/client.gen.go is excluded by !**/gen/**, !internal/openchoreo-api/api/gen/**
  • internal/openchoreo-api/api/gen/models.gen.go is excluded by !**/gen/**, !internal/openchoreo-api/api/gen/**
  • internal/openchoreo-api/api/gen/server.gen.go is excluded by !**/gen/**, !internal/openchoreo-api/api/gen/**
📒 Files selected for processing (123)
  • api/v1alpha1/componentreleasebinding_types.go
  • api/v1alpha1/releasebinding_types.go
  • cmd/main.go
  • config/rbac/role.yaml
  • config/webhook/manifests.yaml
  • docs/crds/renderedrelease.md
  • docs/resource-kind-reference-guide.md
  • docs/templating/context.md
  • install/helm/openchoreo-control-plane/crds/openchoreo.dev_componentreleasebindings.yaml
  • install/helm/openchoreo-control-plane/crds/openchoreo.dev_releasebindings.yaml
  • install/helm/openchoreo-control-plane/templates/controller-manager/controller-manager-role.yaml
  • internal/authz/core/actions.go
  • internal/controller/componentreleasebinding/controller.go
  • internal/controller/componentreleasebinding/controller_conditions.go
  • internal/controller/componentreleasebinding/controller_connections.go
  • internal/controller/componentreleasebinding/controller_connections_integration_test.go
  • internal/controller/componentreleasebinding/controller_finalize.go
  • internal/controller/componentreleasebinding/controller_integration_test.go
  • internal/controller/componentreleasebinding/controller_resourcedependencies.go
  • internal/controller/componentreleasebinding/controller_resourcedependencies_integration_test.go
  • internal/controller/componentreleasebinding/controller_resourcedependencies_test.go
  • internal/controller/componentreleasebinding/controller_status.go
  • internal/controller/componentreleasebinding/controller_unit_test.go
  • internal/controller/componentreleasebinding/controller_watch.go
  • internal/controller/componentreleasebinding/controller_watch_dataplane_test.go
  • internal/controller/componentreleasebinding/endpoint_resolve.go
  • internal/controller/componentreleasebinding/endpoint_resolve_test.go
  • internal/controller/componentreleasebinding/suite_test.go
  • internal/controller/componentreleasebinding/workload_type.go
  • internal/controller/releasebinding/controller.go
  • internal/controller/releasebinding/controller_conditions.go
  • internal/controller/watch.go
  • internal/occ/cmd/componentreleasebinding/cmd.go
  • internal/occ/cmd/componentreleasebinding/cmd_test.go
  • internal/occ/cmd/componentreleasebinding/derive_pipeline_test.go
  • internal/occ/cmd/componentreleasebinding/generate_test.go
  • internal/occ/cmd/componentreleasebinding/params.go
  • internal/occ/cmd/componentreleasebinding/params_test.go
  • internal/occ/cmd/componentreleasebinding/releasebinding.go
  • internal/occ/cmd/componentreleasebinding/releasebinding_test.go
  • internal/occ/cmd/componentreleasebinding/resolver.go
  • internal/occ/cmd/componentreleasebinding/resolver_test.go
  • internal/occ/cmd/releasebinding/cmd.go
  • internal/occ/resources/client/interface.go
  • internal/occ/resources/client/mocks/client.go
  • internal/occ/resources/client/mocks/clientwithresponsesinterface.go
  • internal/occ/resources/client/openapi_client.go
  • internal/openchoreo-api/api/handlers/component_release_bindings.go
  • internal/openchoreo-api/api/handlers/component_release_bindings_http_test.go
  • internal/openchoreo-api/api/handlers/component_release_bindings_test.go
  • internal/openchoreo-api/services/componentreleasebinding/errors.go
  • internal/openchoreo-api/services/componentreleasebinding/interface.go
  • internal/openchoreo-api/services/componentreleasebinding/mocks/service.go
  • internal/openchoreo-api/services/componentreleasebinding/service.go
  • internal/openchoreo-api/services/componentreleasebinding/service_authz.go
  • internal/openchoreo-api/services/componentreleasebinding/service_authz_test.go
  • internal/openchoreo-api/services/componentreleasebinding/service_test.go
  • internal/openchoreo-api/services/handlerservices/services.go
  • internal/openchoreo-api/services/testutil/testutil.go
  • internal/pipeline/component/context/component.go
  • internal/pipeline/component/context/trait.go
  • internal/pipeline/component/context/types.go
  • internal/pipeline/component/pipeline.go
  • internal/pipeline/component/types.go
  • internal/webhook/componentreleasebinding/suite_test.go
  • internal/webhook/componentreleasebinding/webhook.go
  • internal/webhook/componentreleasebinding/webhook_test.go
  • openapi/openchoreo-api.yaml
  • pkg/mcp/tools/component.go
  • samples/component-alerts/README.md
  • samples/component-alerts/failure-scenario-setup.yaml
  • samples/component-types/component-grpc-service/README.md
  • samples/component-types/component-grpc-service/grpc-service-component.yaml
  • samples/component-types/component-http-openapi-service/README.md
  • samples/component-types/component-http-openapi-service/http-openapi-service-component.yaml
  • samples/component-types/component-http-service/README.md
  • samples/component-types/component-http-service/http-service-component.yaml
  • samples/component-types/component-tls-service/README.md
  • samples/component-types/component-tls-service/tls-service-component.yaml
  • samples/component-types/component-web-app/README.md
  • samples/component-types/component-web-app/webapp-component.yaml
  • samples/component-types/component-with-configs/README.md
  • samples/component-types/component-with-configs/component-with-configs.yaml
  • samples/component-types/component-with-embedded-traits/README.md
  • samples/component-types/component-with-embedded-traits/component-with-embedded-traits.yaml
  • samples/from-image/doclet/README.md
  • samples/from-image/echo-websocket-service/README.md
  • samples/from-image/go-greeter-service/README.md
  • samples/from-image/issue-reporter-schedule-task/README.md
  • samples/from-image/issue-reporter-schedule-task/github-issue-reporter.yaml
  • samples/from-image/react-starter-web-app/README.md
  • samples/from-image/url-shortener/README.md
  • samples/from-image/url-shortener/alerting-demo/enable-alert.yaml
  • samples/from-image/url-shortener/alerting-demo/failure-scenario.yaml
  • samples/from-source/services/ballerina-buildpack-patient-management/README.md
  • samples/from-source/services/go-docker-greeter/README.md
  • samples/from-source/services/go-google-buildpack-reading-list/README.md
  • samples/from-source/web-apps/react-starter/README.md
  • samples/gcp-microservices-demo/README.md
  • samples/mcp/log-analysis/README.md
  • samples/mcp/resource-optimization/README.md
  • samples/occ-cli/go-greeter-manual-deploy/README.md
  • test/e2e/framework/wait.go
  • test/e2e/suites/alerts/alerts_fixtures_test.go
  • test/e2e/suites/build/build_fixtures_test.go
  • test/e2e/suites/build/build_test.go
  • test/e2e/suites/connections/connections_test.go
  • test/e2e/suites/gateway/gateway_fixtures_test.go
  • test/e2e/suites/gateway/gateway_test.go
  • test/e2e/suites/gitops/gitops_fixtures_test.go
  • test/e2e/suites/gitops/gitops_test.go
  • test/e2e/suites/mcp/mcp_test.go
  • test/e2e/suites/microservicesdemo/microservicesdemo_test.go
  • test/e2e/suites/networkpolicy/networkpolicy_fixtures_test.go
  • test/e2e/suites/networkpolicy/networkpolicy_test.go
  • test/e2e/suites/observability/observability_fixtures_test.go
  • test/e2e/suites/observability/observability_test.go
  • test/e2e/suites/occ/occ_commands_test.go
  • test/e2e/suites/openchoreoapi/fixtures_test.go
  • test/e2e/suites/openchoreoapi/openchoreoapi_test.go
  • test/e2e/suites/secrets/secrets_test.go
  • test/e2e/suites/workloadtypes/workloadtypes_fixtures_test.go
  • test/e2e/suites/workloadtypes/workloadtypes_test.go

📝 Walkthrough

Changed files by top-level folder:

  • internal/: 36
  • docs/: 3
  • install/: 3
  • api/: 2
  • config/: 2
  • cmd/: 1

API/CRD surface changes:

  • Added new ComponentReleaseBinding API type and CRD, including new spec/status models and scheme registration.
  • Marked legacy ReleaseBinding as deprecated in both API docs and CRD manifests.
  • Enabled /componentreleasebindings API surface and deprecated /releasebindings.
  • Compatibility risk: high. This is a naming break plus a migration path, even though legacy bindings continue to reconcile.

What changed:

  • New ComponentReleaseBinding controller, webhook, RBAC, and watch/index plumbing.
  • Legacy ReleaseBinding now emits a deprecation condition during reconciliation.
  • Templating context resolution now reads environment configs from ComponentReleaseBinding fields.
  • OCC CLI/client support was added for componentreleasebinding, with old releasebinding CLI marked deprecated.
  • Samples/docs/helm CRDs were updated to the new naming.

Tests added/updated:

  • Controller unit/integration coverage for reconciliation, finalization, status conditions, connection/resource-dependency resolution, endpoint URL resolution, dataplane watches, and secret-reference handling.
  • OCC command tests for list/get/delete/generate flows and resolver behavior.
  • Existing ReleaseBinding path deprecation behavior is also covered.
  • Remaining gaps: no evidence of full end-to-end upgrade/migration tests for live clusters, and no explicit coverage shown for every in-tree consumer named in the objective (e.g. cluster-gateway/agent/observer) beyond controller/OCC paths.

Risk hotspots:

  • Authn/authz: new action constants and client wiring expand authorization surface.
  • RBAC: new CRD verbs/resources and webhook/controller permissions for ComponentReleaseBinding.
  • Secrets: secret-reference collection/resolution now affects rendering and env injection.
  • Reconciliation loops: new watches/indexes and side-by-side migration logic can trigger requeues or stale-state edge cases.
  • Install/upgrade: CRD, webhook, and CLI deprecation/migration paths must stay aligned to avoid upgrade regressions.

Walkthrough

This PR introduces the ComponentReleaseBinding CRD as a replacement for the deprecated ReleaseBinding, adding its API types, controller (reconcile, connections, resource dependencies, endpoint resolution, finalization, watch indexing, status evaluation), RBAC/webhook manifests, OCC CLI commands, generated client/mocks, and documentation updates.

Changes

ComponentReleaseBinding Introduction

Layer / File(s) Summary
API type and CRD/RBAC/webhook manifests
api/v1alpha1/componentreleasebinding_types.go, install/helm/.../crds/openchoreo.dev_componentreleasebindings.yaml, config/rbac/role.yaml, config/webhook/manifests.yaml, install/helm/.../controller-manager-role.yaml, internal/authz/core/actions.go, cmd/main.go, internal/controller/watch.go, internal/occ/resources/client/interface.go
Defines ComponentReleaseBinding spec/status types and CRD schema, registers RBAC rules and mutating/validating webhooks, adds authz action constants, and wires the reconciler/webhook into cmd/main.go.
ReleaseBinding deprecation
api/v1alpha1/releasebinding_types.go, internal/controller/releasebinding/*, internal/occ/cmd/releasebinding/cmd.go, install/helm/.../openchoreo.dev_releasebindings.yaml
Marks the legacy ReleaseBinding type, CLI command, and CRD as deprecated, and sets a Deprecated condition on every reconcile.
Core reconciler and readiness evaluation
internal/controller/componentreleasebinding/controller.go, controller_conditions.go, controller_status.go, workload_type.go
Implements the reconcile loop, rendering pipeline integration, RenderedRelease sync for dataplane/observability planes, workload classification, and per-workload readiness condition logic.
Finalization handling
internal/controller/componentreleasebinding/controller_finalize.go
Adds finalizer management and cleanup of owned RenderedRelease resources before deletion.
Connection and resource dependency resolution
controller_connections.go, controller_resourcedependencies.go
Resolves workload connection targets and resource dependencies against provider bindings, updating status conditions.
Endpoint/Service URL resolution
endpoint_resolve.go
Resolves in-cluster Service URLs for workload endpoints from rendered manifests.
Watch/indexing
controller_watch.go
Registers field indexes and watch predicates that propagate reconciliation across dependent bindings.
Controller test suites
internal/controller/componentreleasebinding/*_test.go
Adds unit and integration tests for reconciliation, connections, resource dependencies, endpoint resolution, and watch behavior.
OCC CLI commands and tests
internal/occ/cmd/componentreleasebinding/*
Adds componentreleasebinding CLI subcommands (generate/list/get/delete) with params, resolver, and tests.
OCC API client and mocks
internal/occ/resources/client/openapi_client.go, mocks/*
Adds CRUD/list client methods and regenerates mocks for ComponentReleaseBinding.
Documentation updates
docs/crds/renderedrelease.md, docs/resource-kind-reference-guide.md, docs/templating/context.md
Updates docs to reference ComponentReleaseBinding instead of ReleaseBinding.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Reconciler as componentreleasebinding.Reconciler
  participant Pipeline as componentpipeline.Pipeline
  participant RenderedRelease
  participant ProviderCRB as Provider ComponentReleaseBinding
  Reconciler->>Reconciler: validateComponentRelease / buildMetadataContext
  Reconciler->>Reconciler: resolveConnections / resolveResourceDependencies
  Reconciler->>ProviderCRB: list matching bindings by index key
  ProviderCRB-->>Reconciler: endpoints / outputs
  Reconciler->>Pipeline: Render(component, traits, workload)
  Pipeline-->>Reconciler: rendered manifests
  Reconciler->>RenderedRelease: CreateOrUpdate dataplane/observability release
  Reconciler->>Reconciler: setReadyCondition / setResourcesReadyStatus
Loading

Possibly related PRs

  • openchoreo/openchoreo#3404: Introduces the analogous resource-dependency target tracking, resolution, and reverse-watch logic for ReleaseBinding that this PR replicates for ComponentReleaseBinding.

Suggested reviewers: chathuranga95, ChathurangaKCD, akila-i, binoyPeries, isala404, JanakaSandaruwan, mevan-karu, Mirage20, nilushancosta, VajiraPrabuddhaka, yashodgayashan, LakshanSS

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

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.

🔧 ast-grep (0.44.0)
internal/occ/resources/client/mocks/clientwithresponsesinterface.go

ast-grep timed out on this file


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.

@kavix kavix closed this Jul 3, 2026
@kavix
kavix deleted the rename-releasebinding-3728 branch July 3, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename ReleaseBinding to ComponentReleaseBinding

1 participant