Skip to content

Conversation

@CrystalChun
Copy link
Contributor

@CrystalChun CrystalChun commented Dec 5, 2025

Previously, dual-stack network ordering was not guaranteed when fetching a cluster from the DB since the fields are
text fields.

In order to guarantee the order, every fetch for the cluster from the db will add a postgres clause for the network
subtables.

The postgres clause gets the ip family of the network ip addresses or cidrs, and will return them in order based on the primary_ip_stack column for that cluster.

Clause that gets added to every network table (api_vips, ingress_vips, cluster_networks, machine_networks, and service_networks) on select/get:

INNER JOIN clusters ON clusters.id = <table name>.cluster_id
CASE WHEN clusters.primary_ip_stack = family(<column name>) 
    THEN 0 
     ELSE 1 
END ASC

Includes the following DB column type changes:

column name previous column type new column type remarks
ip text inet native postgres type; part of the following sub-tables: api_vips and ingress_vips
cidr text cidr native postgres type; part of the following sub-tables: cluster_networks, machine_networks, and service_networks
primary_ip_stack text int switched to simplify query for matching IPs

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested): See below
  • No tests needed

Manual Testing

See PR Testing section of doc https://docs.google.com/document/d/1fzQQLUrJwmyU_XvSrizoi-AVrcvIxVGuAxcd7kIZb2Q/edit?usp=sharing

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 5, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 5, 2025

@CrystalChun: This pull request references MGMT-22189 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.21.0" version, but no target version was set.

Details

In response to this:

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link

openshift-ci bot commented Dec 5, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 5, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 5, 2025

Walkthrough

Removed automatic in-code reordering of cluster network records; introduced explicit primary-IP-stack determination and validation; moved network-family ordering into DB load callbacks; added documentation for primary-stack behavior and tests covering single-/dual-stack ordering and retrieval.

Changes

Cohort / File(s) Summary
Documentation
docs/user-guide/network-configuration/dual-stack.md
Added "Primary Stack" section explaining how primary IP stack is derived from the first network family in each network field, example payloads (IPv4-first), and support-version notes for IPv6-primary behavior.
Remove in-code network reordering
internal/bminventory/inventory.go, internal/bminventory/inventory_v2_handlers.go
Deleted orderClusterNetworks and removed its call sites from lifecycle handlers (install, update, reset, complete); added a TODO about defaults for IPv6-primary clusters; handlers no longer reorder networks.
Primary IP stack validation
internal/bminventory/inventory_test.go, internal/bminventory/...
Replaced implicit reordering with explicit getPrimaryIPStack-style validation on full/partial updates; validates network family consistency and ordering, returning errors for mixed/inconsistent families; tests updated/added.
DB-level IP-family ordering helpers
internal/common/db.go
Added OrderByIPFamily(netType, tableName string) and addNetworkCondition(...); integrated family-aware ordering into LoadTableFromDB preload conditions for network tables (machine_networks, cluster_networks, service_networks, api_vips, ingress_vips).
DB tests for ordering
internal/common/db_test.go
Added tests for GetClusterFromDB covering IPv4/IPv6 single-stack, dual-stack (IPv4-first, IPv6-first, and primary_ip_stack driven ordering), and empty-network cases; added helper constructors (dualStackCluster, ipv4Cluster, ipv6Cluster). (Test block duplicated in diff.)
Module deps update
api/go.mod
Added indirect dependencies github.com/jackc/pgio v1.0.0 and github.com/jackc/pgtype v1.14.4.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

  • Areas to focus on:
    • Correctness of primary-IP-stack determination and validations for partial/full updates (edge cases).
    • SQL generated by OrderByIPFamily GORM callback and behavior when primary_ip_stack is nil.
    • Ensure removal of orderClusterNetworks did not leave lifecycle paths assuming reordered state.
    • Duplicate test block in internal/common/db_test.go — confirm intentionality or remove duplicate.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between cd089fc and da453a4.

⛔ Files ignored due to path filters (258)
  • api/go.sum is excluded by !**/*.sum
  • api/vendor/github.com/jackc/pgio/.travis.yml is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgio/LICENSE is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgio/README.md is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgio/doc.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgio/write.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/CHANGELOG.md is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/LICENSE is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/README.md is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/aclitem.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/aclitem_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/array_type.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bit.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bool.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bool_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/box.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bpchar.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bpchar_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bytea.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bytea_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/cid.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/cidr.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/cidr_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/circle.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/composite_fields.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/composite_type.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/convert.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/database_sql.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/date.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/date_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/daterange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/enum_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/enum_type.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/float4.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/float4_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/float8.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/float8_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/generic_binary.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/generic_text.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/hstore.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/hstore_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/inet.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/inet_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int2.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int2_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int4.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int4_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int4_multirange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int4range.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int8.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int8_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int8_multirange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int8range.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/interval.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/json.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/json_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/jsonb.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/jsonb_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/line.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/lseg.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/ltree.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/macaddr.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/macaddr_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/multirange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/name.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/num_multirange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/numeric.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/numeric_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/numrange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/oid.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/oid_value.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/path.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/pgtype.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/pguint32.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/point.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/polygon.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/qchar.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/range.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/record.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/record_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/text.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/text_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tid.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/time.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/timestamp.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/timestamp_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/timestamptz.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/timestamptz_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tsrange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tsrange_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tstzrange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tstzrange_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_array.go.erb is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_array_gen.sh is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_multirange.go.erb is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_multirange_gen.sh is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_range.go.erb is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_range_gen.sh is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/unknown.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/uuid.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/uuid_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/varbit.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/varchar.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/varchar_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/xid.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/custom.go is excluded by !**/vendor/**
  • api/vendor/modules.txt is excluded by !**/vendor/**
  • client/go.sum is excluded by !**/*.sum
  • client/vendor/github.com/jackc/pgio/.travis.yml is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgio/LICENSE is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgio/README.md is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgio/doc.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgio/write.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/CHANGELOG.md is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/LICENSE is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/README.md is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/aclitem.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/aclitem_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/array_type.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bit.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bool.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bool_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/box.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bpchar.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bpchar_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bytea.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bytea_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/cid.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/cidr.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/cidr_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/circle.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/composite_fields.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/composite_type.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/convert.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/database_sql.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/date.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/date_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/daterange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/enum_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/enum_type.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/float4.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/float4_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/float8.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/float8_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/generic_binary.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/generic_text.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/hstore.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/hstore_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/inet.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/inet_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int2.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int2_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int4.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int4_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int4_multirange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int4range.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int8.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int8_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int8_multirange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int8range.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/interval.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/json.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/json_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/jsonb.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/jsonb_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/line.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/lseg.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/ltree.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/macaddr.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/macaddr_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/multirange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/name.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/num_multirange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/numeric.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/numeric_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/numrange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/oid.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/oid_value.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/path.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/pgtype.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/pguint32.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/point.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/polygon.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/qchar.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/range.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/record.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/record_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/text.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/text_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/tid.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/time.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/timestamp.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/timestamp_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/timestamptz.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/timestamptz_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/tsrange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/tsrange_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/tstzrange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/tstzrange_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/typed_array.go.erb is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/typed_array_gen.sh is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/typed_multirange.go.erb is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/typed_multirange_gen.sh is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/typed_range.go.erb is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/typed_range_gen.sh is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/unknown.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/uuid.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/uuid_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/varbit.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/varchar.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/varchar_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/xid.go is excluded by !**/vendor/**
  • client/vendor/github.com/openshift/assisted-service/models/custom.go is excluded by !**/vendor/**
  • client/vendor/modules.txt is excluded by !**/vendor/**
  • go.sum is excluded by !**/*.sum
  • models/go.sum is excluded by !**/*.sum
  • models/vendor/github.com/jackc/pgio/.travis.yml is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgio/LICENSE is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgio/README.md is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgio/doc.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgio/write.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/CHANGELOG.md is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/LICENSE is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/README.md is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/aclitem.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/aclitem_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/array_type.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/bit.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/bool.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/bool_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/box.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/bpchar.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/bpchar_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/bytea.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/bytea_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/cid.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/cidr.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/cidr_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/circle.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/composite_fields.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/composite_type.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/convert.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/database_sql.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/date.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/date_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/daterange.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/enum_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/enum_type.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/float4.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/float4_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/float8.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/float8_array.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/generic_binary.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/generic_text.go is excluded by !**/vendor/**
  • models/vendor/github.com/jackc/pgtype/hstore.go is excluded by !**/vendor/**
📒 Files selected for processing (1)
  • api/go.mod (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • api/go.mod
🔇 Additional comments (1)
api/go.mod (1)

48-49: Dependencies appropriately added for PostgreSQL type support.

The two new indirect dependencies (jackc/pgio and jackc/pgtype) are necessary to handle PostgreSQL inet and cidr types when loading and ordering dual-stack networks by IP family. These versions are compatible with PostgreSQL 12, which aligns with the codebase constraints; the EOL/archival concern flagged in previous reviews was already addressed and resolved.


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 5, 2025
@openshift-ci
Copy link

openshift-ci bot commented Dec 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CrystalChun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 5, 2025
@CrystalChun CrystalChun force-pushed the dual-stack-ip-order branch 12 times, most recently from 900be67 to 4f0addb Compare December 8, 2025 23:08
if params.NewClusterParams.ClusterNetworks == nil {
params.NewClusterParams.ClusterNetworks = []*models.ClusterNetwork{
{Cidr: models.Subnet(b.Config.DefaultClusterNetworkCidr), HostPrefix: b.Config.DefaultClusterNetworkHostPrefix},
{Cidr: models.Subnet(b.Config.DefaultClusterNetworkCidr), HostPrefix: b.Config.DefaultClusterNetworkHostPrefix}, //TODO: what if it's a dual-stack cluster with primary IPv6
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@linoyaslan Would appreciate your thoughts!

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I’m aware of this. it was already discussed during the initial implementation of the feature. In the UI, this is handled by adjusting the defaults for the user. However, on the API side, the user still needs to handle this manually. If they don’t, they’ll receive an error about an inconsistent family stack, and the error message is informative enough to guide them on what needs to be changed.
That said, due to some recent changes we made after the initial implementation, I think we now exec the defaults method after the initial primary IP stack computation. This might allow us to introduce an additional defaulting function for primary IPv6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah gotcha, thank you for the explanation!

I think we now exec the defaults method after the initial primary IP stack computation. This might allow us to introduce an additional defaulting function for primary IPv6?

Yes, we do! Perhaps we can add the defaulting in a different issue/PR then as a follow up. I've edited the todo for the function.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 9, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 9, 2025
@linoyaslan
Copy link
Contributor

looks good to me :) I’d like to get @danmanor’s opinion, since he was involved in my implementation and may have additional insights here

@CrystalChun CrystalChun force-pushed the dual-stack-ip-order branch 2 times, most recently from 9e59ae9 to 206cd9d Compare December 10, 2025 20:24
@CrystalChun CrystalChun marked this pull request as ready for review December 10, 2025 20:24
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 18, 2025
// Verify the column type after migration
colType, err = getColumnType(dbName, &common.Cluster{}, "primary_ip_stack")
Expect(err).ToNot(HaveOccurred())
Expect(colType).To(Equal("int4"))
Copy link
Contributor

@linoyaslan linoyaslan Dec 19, 2025

Choose a reason for hiding this comment

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

I’m not completely sure when the column type is shown as int4 and when as integer. In the migration you check for integer / bigint, but here the type appears as int4.
this might depend on what you specify in the SQL vs how the database reports it? anyway, I just wanted to point this out so we can double-check that this is expected and that we are not missing anything here.

https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-INT
"SQL only specifies the integer types integer (or int), smallint, and bigint. The type names int2, int4, and int8 are extensions, which are also used by some other SQL database systems."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The getColumnType function uses GORM's DatabaseTypeName() which returns PostgreSQL's internal type name:
INTEGER → returns int4
BIGINT → returns int8
TEXT → returns text

Thanks for bringing this up! It is interesting that there's a discrepancy

var invalidValues []string
err = tx.Raw(fmt.Sprintf(`
SELECT DISTINCT %s FROM %s
WHERE %s !~ '^[0-9a-fA-F.:]+(/[0-9]+)?$'
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn’t this regex also allow something like 999.888.777.666? but the db might break in the migration since 999 isn’t a valid octet which inet/cidr expect? not 100% sure about that, but probably good to check

Copy link
Contributor

Choose a reason for hiding this comment

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

oh I now see your comment "This regex is permissive - it catches obvious garbage but lets PostgreSQL do final validation". when does Postgres validate it? During cleanAndValidateNetworkData, or only later?

Copy link
Contributor Author

@CrystalChun CrystalChun Dec 19, 2025

Choose a reason for hiding this comment

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

Change primary ip stack to an int to simplify the
SQL query. Includes migrations to move any previously
filled column where primary ip stack was a text type.
Previously, dual-stack network ordering was not guaranteed
when fetching a cluster from the DB since the fields are
text fields.

In order to guarantee the order, every fetch for the cluster
from the db will add a postgres clause for the network
subtables.

The postgres clause gets ip family of the network ip address
or cidrs, and will then order them based on the primary_ip_family
column for that cluster.
Postgres types inet and cidr have additional stricter
validation requirements.

Changes made:
- cidrs cannot have bits to the right of the mask specified
so the cidrs in the tests are edited to respect that
- inet and cidrs are not allowed to be empty or null
so any test that previously specified an empty or null
ip or cidr are removed.
- Default cidrs in the inventory are configured in tests ahead
of time so they won't be empty during the tests
@CrystalChun CrystalChun force-pushed the dual-stack-ip-order branch 5 times, most recently from 5c8d5b9 to 8e35ea6 Compare December 19, 2025 20:05
@CrystalChun CrystalChun reopened this Dec 19, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 19, 2025

@CrystalChun: This pull request references MGMT-22189 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Previously, dual-stack network ordering was not guaranteed when fetching a cluster from the DB since the fields are
text fields.

In order to guarantee the order, every fetch for the cluster from the db will add a postgres clause for the network
subtables.

The postgres clause gets the ip family of the network ip addresses or cidrs, and will return them in order based on the primary_ip_stack column for that cluster.

Clause that gets added to every network table (api_vips, ingress_vips, cluster_networks, machine_networks, and service_networks) on select/get:

INNER JOIN clusters ON clusters.id = <table name>.cluster_id
CASE WHEN clusters.primary_ip_stack = family(<column name>) 
   THEN 0 
    ELSE 1 
END ASC

Includes the following DB column type changes:

column name previous column type new column type remarks
ip text inet native postgres type; part of the following sub-tables: api_vips and ingress_vips
cidr text cidr native postgres type; part of the following sub-tables: cluster_networks, machine_networks, and service_networks
primary_ip_stack text int switched to simplify query for matching IPs

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested): See below
  • No tests needed

Manual Testing

See PR Testing section of doc https://docs.google.com/document/d/1fzQQLUrJwmyU_XvSrizoi-AVrcvIxVGuAxcd7kIZb2Q/edit?usp=sharing

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@CrystalChun CrystalChun force-pushed the dual-stack-ip-order branch 2 times, most recently from e2839f9 to cd089fc Compare December 19, 2025 23:40
@CrystalChun CrystalChun marked this pull request as ready for review December 19, 2025 23:40
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 19, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 9e0dca9 and cd089fc.

⛔ Files ignored due to path filters (183)
  • api/go.sum is excluded by !**/*.sum
  • api/vendor/github.com/jackc/pgio/.travis.yml is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgio/LICENSE is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgio/README.md is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgio/doc.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgio/write.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/CHANGELOG.md is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/LICENSE is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/README.md is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/aclitem.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/aclitem_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/array_type.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bit.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bool.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bool_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/box.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bpchar.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bpchar_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bytea.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/bytea_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/cid.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/cidr.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/cidr_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/circle.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/composite_fields.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/composite_type.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/convert.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/database_sql.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/date.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/date_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/daterange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/enum_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/enum_type.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/float4.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/float4_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/float8.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/float8_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/generic_binary.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/generic_text.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/hstore.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/hstore_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/inet.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/inet_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int2.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int2_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int4.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int4_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int4_multirange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int4range.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int8.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int8_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int8_multirange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/int8range.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/interval.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/json.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/json_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/jsonb.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/jsonb_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/line.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/lseg.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/ltree.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/macaddr.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/macaddr_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/multirange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/name.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/num_multirange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/numeric.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/numeric_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/numrange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/oid.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/oid_value.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/path.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/pgtype.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/pguint32.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/point.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/polygon.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/qchar.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/range.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/record.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/record_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/text.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/text_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tid.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/time.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/timestamp.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/timestamp_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/timestamptz.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/timestamptz_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tsrange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tsrange_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tstzrange.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/tstzrange_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_array.go.erb is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_array_gen.sh is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_multirange.go.erb is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_multirange_gen.sh is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_range.go.erb is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/typed_range_gen.sh is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/unknown.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/uuid.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/uuid_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/varbit.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/varchar.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/varchar_array.go is excluded by !**/vendor/**
  • api/vendor/github.com/jackc/pgtype/xid.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/api_vip.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/cluster_network.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/custom.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/ingress_vip.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/machine_network.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/service_network.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/verified_vip.go is excluded by !**/vendor/**
  • api/vendor/github.com/openshift/assisted-service/models/verify_vip.go is excluded by !**/vendor/**
  • api/vendor/modules.txt is excluded by !**/vendor/**
  • client/go.sum is excluded by !**/*.sum
  • client/vendor/github.com/jackc/pgio/.travis.yml is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgio/LICENSE is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgio/README.md is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgio/doc.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgio/write.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/CHANGELOG.md is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/LICENSE is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/README.md is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/aclitem.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/aclitem_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/array_type.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bit.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bool.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bool_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/box.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bpchar.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bpchar_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bytea.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/bytea_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/cid.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/cidr.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/cidr_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/circle.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/composite_fields.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/composite_type.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/convert.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/database_sql.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/date.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/date_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/daterange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/enum_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/enum_type.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/float4.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/float4_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/float8.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/float8_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/generic_binary.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/generic_text.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/hstore.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/hstore_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/inet.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/inet_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int2.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int2_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int4.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int4_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int4_multirange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int4range.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int8.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int8_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int8_multirange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/int8range.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/interval.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/json.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/json_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/jsonb.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/jsonb_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/line.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/lseg.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/ltree.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/macaddr.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/macaddr_array.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/multirange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/name.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/num_multirange.go is excluded by !**/vendor/**
  • client/vendor/github.com/jackc/pgtype/numeric.go is excluded by !**/vendor/**
📒 Files selected for processing (1)
  • api/go.mod (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • api/go.mod

Now that IP and subnet are ip and cidr postgres types,
we'll need to migrate the columns in case assisted-service
is upgraded from a prior version.
Now that the DB validation for CIDRs is more strict, the
business logic should add these validations ahead of the
DB errors to prevent them.
@CrystalChun
Copy link
Contributor Author

/retest-required

@openshift-ci
Copy link

openshift-ci bot commented Dec 22, 2025

@CrystalChun: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-images da453a4 link true /test okd-scos-images

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants