Skip to content

Add "regionRef" to Endpoint resource - #873

Open
gndrmnn wants to merge 11 commits into
k-orc:mainfrom
C5C3:endpoint_region
Open

Add "regionRef" to Endpoint resource#873
gndrmnn wants to merge 11 commits into
k-orc:mainfrom
C5C3:endpoint_region

Conversation

@gndrmnn

@gndrmnn gndrmnn commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This uses the Region resource implemented in #862 and therefore uses that branch as a base. We would obviously need to merge #862 first.

Other than that I consider this change good to go.

gndrmnn added 10 commits July 15, 2026 13:48
$ go run ./cmd/scaffold-controller -interactive=false \
    -kind=Region \
    -gophercloud-client=NewIdentityV3 \
    -gophercloud-module=github.com/gophercloud/gophercloud/v2/openstack/identity/v3/regions \
    -gophercloud-type=Region \
    -openstack-json-object=region

On-behalf-of: SAP nils.gondermann@sap.com
Register with the resource generator

On-behalf-of: SAP nils.gondermann@sap.com
Add the OpenStack client to scope

On-behalf-of: SAP nils.gondermann@sap.com
Register the controller

On-behalf-of: SAP nils.gondermann@sap.com
On-behalf-of: SAP nils.gondermann@sap.com
On-behalf-of: SAP nils.gondermann@sap.com
On-behalf-of: SAP nils.gondermann@sap.com
On-behalf-of: SAP nils.gondermann@sap.com
Generate the OLM bundle

On-behalf-of: SAP nils.gondermann@sap.com
On-behalf-of: SAP nils.gondermann@sap.com
@github-actions github-actions Bot added the semver:major Breaking change label Aug 4, 2026
@gndrmnn
gndrmnn marked this pull request as ready for review August 4, 2026 10:21
On-behalf-of: SAP nils.gondermann@sap.com
# We expect the deletion to hang due to the finalizer, so use --wait=false
- command: kubectl delete service.openstack.k-orc.cloud endpoint-dependency --wait=false
namespaced: true
- command: kubectl delete region.openstack.k-orc.cloud endpoint-dependency --wait=false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The tests fail with:

case.go:335: failed to get referenced resource 'kuttl-sensible-bat-h57l/endpoint-dependency': regions.openstack.k-orc.cloud "endpoint-dependency" not found

I'm not exactly sure why... Because it was apparently created successfully in the previous step.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From what I can see, the region is being created and indeed being deleted, not hanging waiting for a finalizer. I think this is a consequence of using FetchDependency which doesn't add the finalizer to the resource unlike the GetDependency. Suggested that.

@@ -38,3 +38,18 @@ spec:
serviceRef: endpoint-dependency
interface: internal
url: http://example.com

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You should ideally also add a resolved regionRef to the other endpoints.

Then you would need 2 regions: endpoint-dependency that we create in step0 that is the resolved dependency and endpoint-dependency-pending that we create in step1 that is the one we'll be waiting on (similar to what we do for Service).

Comment on lines +62 to +65
if osResource.Region != "" {
resourceStatus.WithRegion(osResource.Region)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW, the Keystone catalog API deprecated the region parameter as of v3.2, and now the API returns the region ID (and also the region field).

It would be good to have the most supported field here in the future. This involves a change on Gophercloud to support this field. Filed gophercloud/gophercloud#3943

return nil, false
}

region, _ := dependency.FetchDependency[*orcv1alpha1.Region](

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Change to regionDependency.GetDependency so we add the finalizer to the resource in case of adoption.

# We expect the deletion to hang due to the finalizer, so use --wait=false
- command: kubectl delete service.openstack.k-orc.cloud endpoint-dependency --wait=false
namespaced: true
- command: kubectl delete region.openstack.k-orc.cloud endpoint-dependency --wait=false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From what I can see, the region is being created and indeed being deleted, not hanging waiting for a finalizer. I think this is a consequence of using FetchDependency which doesn't add the finalizer to the resource unlike the GetDependency. Suggested that.

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

Labels

semver:major Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants