Skip to content

Resource primary identifiers are not properly detected #842

@RedbackThomson

Description

@RedbackThomson

Describe the bug
The runtime attempts to determine the unique resource identifier (used to identify resources in the ReadOne) call using the name of the fields.
It does so by finding any fields named "Name", "{Resource}Name", "ID", "{Resource}ID" in that order.
For some resources, such as the MQ Broker, the unique resource identifier used in ReadOne is "BrokerID", but the runtime incorrectly determines it to be "Name" since the "Name" field also appears in the Create* spec.

Steps to reproduce

  1. Run the current code-generator for the MQ repository.
  2. See pkg/resource/broker/resource.go L83 contains r.ko.Spec.Name = identifier.NameOrID

Expected outcome
pkg/resource/broker/resource.go L83 contains r.ko.Spec.BrokerID = identifier.NameOrID

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions