Skip to content

Data source tag filtering is broken #136

Description

@alakae

Filtering data sources by tags does not work — no resources are ever returned when a tags filter is specified.

Important note: The tag filtering for data sources was not documented/tested as a feature for any data source, until recently when I added it to the volume data source, when I noticed that, the underlying schema accepts it.

Root cause: gatherXxxResourceData stores tags as cloudscale.TagMap (map[string]string), but d.GetOk("tags") returns map[string]interface{}. When compared via != as interface{} values, Go sees two different dynamic types and the comparison is always true (not equal), so no resource ever matches.

Research / Decision needed: Should tag filtering use subset semantics (resource contains at least the specified tags) or exact match (resource tags must be identical to the filter)? I am not sure, what the expected behavior was, right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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