Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Go-Binding: Validation detects duplicate instead of using the version attribute #50

@enrico-kaack-comp

Description

@enrico-kaack-comp

What happened:
The go-binding behaves not according to spec when presented with two component references that only differ in name. The validation fails with a duplicated dependency error.

What you expected to happen:
Based on the spec, if two referenced artifacts (componentReference, resource, source) collide based on their name and extra identity, the version is implicitly added to the identity:

In v2, for backwards-compatibility-reasons, the (mandatory) version attribute is implicitly added to the set of additional identity attributes iff it is not explicitly declared as such, and the uniqueness constraint would otherwise be violated.

(https://gardener.github.io/component-spec/semantics.html#identities-and-accessors)

Anything else we need to know:
Root cause for this bug is probably in:
https://github.com/gardener/component-spec/blob/139929baecedfce543c389c1d09a065cc25b3c13/bindings-go/apis/v2/componentdescriptor.go#L230

Need to make sure this is correctly handled when accessing referenced artifacts as well.

Environment:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBuglifecycle/rottenNobody worked on this for 12 months (final aging stage)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions