Skip to content

Bug: One-shot attach (Pending → Attached) uses wrong service lookup for address population #235

@coderabbitai

Description

@coderabbitai

Summary

In the handleProvisioning OnSuccess callback, the one-shot attach path (Pending → Attached, where spec.ComputeInstance is already set before provisioning begins) incorrectly calls getPublicIPAddress which looks up the parking service (osac-pip-<name> in metallb-system). However, after a provisioning playbook with one-shot attach completes, the parking service is deleted and replaced by the ingress service (osac-pip-<name>-ingress in the tenant namespace). This means status.address is never populated on the one-shot attach path.

Expected behavior

status.address should be populated after one-shot attach succeeds, mirroring the logic in handleAttaching (lines 680–705) which correctly queries the ingress service in the tenant namespace.

Suggested fix

Instead of duplicating lookup logic in multiple places, introduce a helper function (or two) to abstract:

  1. Parking service IP lookup (osac-pip-<name> in metallb-system)
  2. Ingress service IP lookup (osac-pip-<name>-ingress in the tenant namespace)

The one-shot attach block in handleProvisioning OnSuccess should use the ingress service lookup (same as handleAttaching).

Affected code

internal/controller/publicip_controller.gohandleProvisioning OnSuccess, one-shot attach branch (~lines 877–885).

Notes

Reported by: @akshaynadkarni

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions