Skip to content

V1Secret equals always returns false #431

Closed
@davidxia

Description

@davidxia

Two V1Secret instances deserialized from the same YAML are not equal. In fact, V1Secret.equals(Object o) always returns false. This is because V1Secret.data = Map<String, byte[]>.

private Map<String, byte[]> data = null;

The equals method on a Java array type is equivalent to ==. So this line returns false.

Objects.equals(this.data, v1Secret.data) &&

Would you be open to patches for this? If so, what's the right approach? Keep the V1Secret.data = Map<String, byte[]> and modify the line above to loop through the map checking keys are equal with Objects.equals() and byte[] values are equal with java.util.Arrays.equals(...)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions