Skip to content

Commit

Permalink
Exclude attribute names when reconciling
Browse files Browse the repository at this point in the history
These are not stored in the config (they're calculated based on the schemas of the relevant catalog types) so there's no need to diff them.
  • Loading branch information
paprikati committed Jun 14, 2024
1 parent 11c0ce2 commit d45ee95
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cmd/catalog-importer/cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,20 @@ func (opt *SyncOptions) Run(ctx context.Context, logger kitlog.Logger, cfg *conf
}
}
OUT(" ✔ %s (id=%s)", model.TypeName, catalogType.Id)
DIFF(" ", *catalogType, updatedCatalogType)

// We only have attribute names in the response for a path attribute, not the
// request. To avoid erroneous diffs, we strip the attribute names from any
// path attributes.
catalogTypeToCompare := *catalogType
for _, attr := range catalogType.Schema.Attributes {
if attr.Path != nil {
for i := range *attr.Path {
(*attr.Path)[i].AttributeName = ""
}
}
}

DIFF(" ", catalogTypeToCompare, updatedCatalogType)
}
}
} else {
Expand Down

0 comments on commit d45ee95

Please sign in to comment.