Skip to content

improve: integration test to showcase external resource state in status#3480

Open
csviri wants to merge 1 commit into
nextfrom
external-resource-state-in-status
Open

improve: integration test to showcase external resource state in status#3480
csviri wants to merge 1 commit into
nextfrom
external-resource-state-in-status

Conversation

@csviri

@csviri csviri commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2026 11:44
@openshift-ci openshift-ci Bot requested review from metacosm and xstefank July 8, 2026 11:44
@csviri csviri changed the title external resource state in status improve: external resource state in status Jul 8, 2026
@csviri csviri force-pushed the external-resource-state-in-status branch from d0165ba to 3ef1ccf Compare July 8, 2026 11:45
@csviri csviri changed the base branch from main to next July 8, 2026 11:46
@csviri csviri force-pushed the external-resource-state-in-status branch from 3ef1ccf to c3077df Compare July 8, 2026 11:47
…y status

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@csviri csviri force-pushed the external-resource-state-in-status branch from c3077df to 1b6eae8 Compare July 8, 2026 11:49
@csviri csviri changed the title improve: external resource state in status improve: integration test to showcase external resource state in status Jul 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds new integration-test samples demonstrating how to manage an external resource while persisting the external resource identifier (state) directly in the primary custom resource status, including a workflow-based variant using a dependent resource. It also updates the Maven version across the multi-module build.

Changes:

  • Added a base API sample reconciler + IT showing external state persisted in status and coordinated with a polling event source.
  • Added a workflow sample (dependent resource + reconciler + IT) showing external state persisted in status to avoid duplicate creation.
  • Updated the root and module POMs to use version 999-SNAPSHOT.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pom.xml Sets root project version to 999-SNAPSHOT.
operator-framework/pom.xml Updates parent version to 999-SNAPSHOT.
operator-framework-core/pom.xml Updates parent version to 999-SNAPSHOT.
operator-framework-junit/pom.xml Updates parent version to 999-SNAPSHOT.
operator-framework-bom/pom.xml Updates BOM version to 999-SNAPSHOT.
micrometer-support/pom.xml Updates parent version to 999-SNAPSHOT.
caffeine-bounded-cache-support/pom.xml Updates parent version to 999-SNAPSHOT.
migration/pom.xml Updates parent version to 999-SNAPSHOT.
bootstrapper-maven-plugin/pom.xml Updates parent version to 999-SNAPSHOT.
test-index-processor/pom.xml Updates parent version to 999-SNAPSHOT.
sample-operators/pom.xml Updates parent version to 999-SNAPSHOT.
sample-operators/webpage/pom.xml Updates parent version to 999-SNAPSHOT.
sample-operators/tomcat-operator/pom.xml Updates parent version to 999-SNAPSHOT.
sample-operators/operations/pom.xml Updates parent version to 999-SNAPSHOT.
sample-operators/mysql-schema/pom.xml Updates parent version to 999-SNAPSHOT.
sample-operators/leader-election/pom.xml Updates parent version to 999-SNAPSHOT.
sample-operators/controller-namespace-deletion/pom.xml Updates parent version to 999-SNAPSHOT.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/externalstateinstatus/ExternalStateInStatusReconciler.java New reconciler sample managing an external resource with state stored in status.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/externalstateinstatus/ExternalStateInStatusIT.java New IT validating the base API “state in status” approach.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/externalstateinstatus/ExternalStateInStatusCustomResource.java New CR type for the base API sample.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/externalstateinstatus/ExternalStateInStatusSpec.java New spec POJO for the base API sample.
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/externalstateinstatus/ExternalStateInStatusStatus.java New status POJO holding the external ID for the base API sample.
operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstateinstatus/ExternalStateInStatusDependentResource.java New dependent resource implementing external resource CRUD with ID sourced from status.
operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstateinstatus/ExternalStateInStatusWorkflowReconciler.java New workflow reconciler that patches status with the external ID after dependent reconciliation.
operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstateinstatus/ExternalStateInStatusWorkflowIT.java New IT validating the workflow-based “state in status” approach.
operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstateinstatus/ExternalStateInStatusWorkflowCustomResource.java New CR type for the workflow sample.
operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstateinstatus/ExternalStateInStatusSpec.java New spec POJO for the workflow sample.
operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstateinstatus/ExternalStateInStatusStatus.java New status POJO holding the external ID for the workflow sample.

Comment on lines +71 to +80
if (externalResource.isEmpty()) {
// No external resource is associated with this primary yet. If we already stored an ID we
// are just waiting for the poll to catch up (do nothing), otherwise we create the external
// resource and persist its ID into the status. Relying on read-after-write consistency the
// stored ID is visible on the next reconciliation, so no duplicate is created.
if (idFromStatus(resource) == null) {
return createExternalResource(resource);
}
return UpdateControl.noUpdate();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants